max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
serde/src/gen/thrift/gen-py/megastruct/ttypes.py | amCharlie/hive | 2 | 1100 | <filename>serde/src/gen/thrift/gen-py/megastruct/ttypes.py
#
# Autogenerated by Thrift Compiler (0.13.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TPro... | <filename>serde/src/gen/thrift/gen-py/megastruct/ttypes.py
#
# Autogenerated by Thrift Compiler (0.13.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TPro... | en | 0.210387 | # # Autogenerated by Thrift Compiler (0.13.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # Attributes: - my_string - my_enum Attributes: - my_bool - my_byte - my_16bit_int - my_32bit_int - my_64bit_int - my_double - my_string... | 1.990114 | 2 |
gpMgmt/bin/gpload_test/gpload2/TEST.py | Tylarb/gpdb | 1 | 1101 | <gh_stars>1-10
#!/usr/bin/env python
import unittest
import sys
import os
import string
import time
import socket
import fileinput
import platform
import re
try:
import subprocess32 as subprocess
except:
import subprocess
import pg
def get_port_from_conf():
file = os.environ.get('MASTER_DATA_DIRECTORY')+'... | #!/usr/bin/env python
import unittest
import sys
import os
import string
import time
import socket
import fileinput
import platform
import re
try:
import subprocess32 as subprocess
except:
import subprocess
import pg
def get_port_from_conf():
file = os.environ.get('MASTER_DATA_DIRECTORY')+'/postgresql.con... | en | 0.726682 | #!/usr/bin/env python Global Values Run a command or file against psql. Return True if OK. @param dbname: database name @param ifile: input file @param cmd: command line @param flag: -e Run SQL with no comments (default) -a Run SQL with comments and psql notice @param username: psql... | 2.358233 | 2 |
code_week19_831_96/biao_shi_shu_zi.py | dylanlee101/leetcode | 0 | 1102 | <filename>code_week19_831_96/biao_shi_shu_zi.py
'''
请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。例如,字符串"+100"、"5e2"、"-123"、"3.1416"、"-1E-16"、"0123"都表示数值,但"12e"、"1a3.14"、"1.2.3"、"+-5"及"12e+5.4"都不是。
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/biao-shi-shu-zhi-de-zi-fu-chuan-lcof
'''
class Solution:
def isNumber(self, s: s... | <filename>code_week19_831_96/biao_shi_shu_zi.py
'''
请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。例如,字符串"+100"、"5e2"、"-123"、"3.1416"、"-1E-16"、"0123"都表示数值,但"12e"、"1a3.14"、"1.2.3"、"+-5"及"12e+5.4"都不是。
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/biao-shi-shu-zhi-de-zi-fu-chuan-lcof
'''
class Solution:
def isNumber(self, s: s... | zh | 0.34148 | 请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。例如,字符串"+100"、"5e2"、"-123"、"3.1416"、"-1E-16"、"0123"都表示数值,但"12e"、"1a3.14"、"1.2.3"、"+-5"及"12e+5.4"都不是。 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/biao-shi-shu-zhi-de-zi-fu-chuan-lcof # 0. start with 'blank' # 1. 'sign' before 'e' # 2. 'digit' before 'dot' # 3. 'digit' after 'dot' # ... | 2.853858 | 3 |
teeth_overlord/tests/unit/networks/neutron.py | rackerlabs/teeth-overlord | 0 | 1103 | <reponame>rackerlabs/teeth-overlord
"""
Copyright 2013 Rackspace, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | """
Copyright 2013 Rackspace, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | en | 0.855077 | Copyright 2013 Rackspace, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis... | 1.375249 | 1 |
classes/settings.py | johnyburd/glucometer | 12 | 1104 | def init():
global brightness
global calibration_mode
brightness = 500
calibration_mode = False
| def init():
global brightness
global calibration_mode
brightness = 500
calibration_mode = False
| none | 1 | 1.40924 | 1 | |
typeidea/blog/views.py | Phoenix-sy/typeidea | 0 | 1105 | from datetime import date
from django.core.cache import cache
from django.db.models import Q, F
from django.shortcuts import render
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
#from silk.profiling.profiler import silk_profile
from config.models import SideBar
f... | from datetime import date
from django.core.cache import cache
from django.db.models import Q, F
from django.shortcuts import render
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
#from silk.profiling.profiler import silk_profile
from config.models import SideBar
f... | en | 0.221064 | #from silk.profiling.profiler import silk_profile 重写queryset,根据分类过滤 重写queryset,根据标签过滤 #1分钟有效 def post_list(request, category_id=None, tag_id=None): tag = None category = None if tag_id: post_list, tag = Post.get_by_tag(tag_id) elif category_id: post_list, category=Post.get_by_category(category_id) else: pos... | 1.996112 | 2 |
VMI/VMItest.py | thomasbarillot/DAQ | 1 | 1106 | <reponame>thomasbarillot/DAQ
# -*- coding: utf-8 -*-
"""
Created on Sat May 7 11:38:18 2016
@author: thomasbarillot
VMI control
"""
from ctypes import cdll
#slib="VMIcrtl_ext.dll"
#hlib=cdll('VMIcrtl.dll')
import VMIcrtl_ext
test=VMIcrtl_ext.VMIcrtl()
#%%
print test.GetFilename()
#%%
test.setFilename('20161115_1... | # -*- coding: utf-8 -*-
"""
Created on Sat May 7 11:38:18 2016
@author: thomasbarillot
VMI control
"""
from ctypes import cdll
#slib="VMIcrtl_ext.dll"
#hlib=cdll('VMIcrtl.dll')
import VMIcrtl_ext
test=VMIcrtl_ext.VMIcrtl()
#%%
print test.GetFilename()
#%%
test.setFilename('20161115_1841.dat')
print test.GetFilen... | en | 0.580247 | # -*- coding: utf-8 -*- Created on Sat May 7 11:38:18 2016 @author: thomasbarillot VMI control #slib="VMIcrtl_ext.dll" #hlib=cdll('VMIcrtl.dll') #%% #%% #%% #%% #%% #%% #%% #%% | 2.12323 | 2 |
var/spack/repos/builtin/packages/openssl/package.py | vitodb/spack | 0 | 1107 | <filename>var/spack/repos/builtin/packages/openssl/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
from spack import *
import spac... | <filename>var/spack/repos/builtin/packages/openssl/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
from spack import *
import spac... | en | 0.854 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) # Uses Fake Autotools, should subclass Package OpenSSL is an open source project that provides a robust, commercial-... | 1.352089 | 1 |
vispy/util/profiler.py | izaid/vispy | 0 | 1108 | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# Adapted from PyQtGraph
import sys
from . import ptime
from .. import config
class Profiler(object):
"""Simple profiler allowing directed, hierarchical measurement of ti... | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# Adapted from PyQtGraph
import sys
from . import ptime
from .. import config
class Profiler(object):
"""Simple profiler allowing directed, hierarchical measurement of ti... | en | 0.761488 | # -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # Adapted from PyQtGraph Simple profiler allowing directed, hierarchical measurement of time intervals. By default, profilers are disabled. To enable profiling, set t... | 2.846323 | 3 |
tests/test_processor.py | vijithv/djangosaml2idp | 1 | 1109 | from django.contrib.auth import get_user_model
from djangosaml2idp.processors import BaseProcessor
User = get_user_model()
class TestBaseProcessor:
def test_extract_user_id_configure_by_user_class(self):
user = User()
user.USERNAME_FIELD = 'email'
user.email = 'test_email'
asse... | from django.contrib.auth import get_user_model
from djangosaml2idp.processors import BaseProcessor
User = get_user_model()
class TestBaseProcessor:
def test_extract_user_id_configure_by_user_class(self):
user = User()
user.USERNAME_FIELD = 'email'
user.email = 'test_email'
asse... | en | 0.593663 | Should use `settings.SAML_IDP_DJANGO_USERNAME_FIELD` to determine the user id field | 2.531083 | 3 |
com/ds/SingleLinkedList.py | sasikrishna/python-programs | 0 | 1110 |
class Node:
def __init__(self, data):
self.data = data
self.prev = None
self.next = None
class SingleLinkedList:
def __init__(self):
self.head = None
def add(self, ele):
new_node = Node(ele)
if self.head is None:
self.head = new_node
... |
class Node:
def __init__(self, data):
self.data = data
self.prev = None
self.next = None
class SingleLinkedList:
def __init__(self):
self.head = None
def add(self, ele):
new_node = Node(ele)
if self.head is None:
self.head = new_node
... | none | 1 | 3.746418 | 4 | |
src/data_setup/__init__.py | data-stories/chart-experiment | 0 | 1111 | __all__ = ["data_setup", "chart_params", "base_params"] | __all__ = ["data_setup", "chart_params", "base_params"] | none | 1 | 1.098663 | 1 | |
src/aiocomcrawl/models.py | rudaporto/aiocomcrawl | 0 | 1112 | from datetime import datetime
from typing import Any, List, Optional, Union
from pydantic import BaseModel, Field, HttpUrl, validator
from pydantic.dataclasses import dataclass
class Index(BaseModel):
id: str
name: str
time_gate: HttpUrl = Field(alias="timegate")
cdx_api: HttpUrl = Field(alias="cdx-a... | from datetime import datetime
from typing import Any, List, Optional, Union
from pydantic import BaseModel, Field, HttpUrl, validator
from pydantic.dataclasses import dataclass
class Index(BaseModel):
id: str
name: str
time_gate: HttpUrl = Field(alias="timegate")
cdx_api: HttpUrl = Field(alias="cdx-a... | en | 0.857802 | # todo: these are still raw strings Request existing pages on one index for a given url. Response with the total number of pages in this index for a given url. One page that contains records to be fetched. | 2.490868 | 2 |
fs/error_tools.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 0 | 1113 | <gh_stars>0
"""Tools for managing OS errors.
"""
from __future__ import print_function
from __future__ import unicode_literals
import errno
from contextlib import contextmanager
import sys
import platform
from . import errors
from six import reraise
_WINDOWS_PLATFORM = platform.system() == 'Windows'
class _Conv... | """Tools for managing OS errors.
"""
from __future__ import print_function
from __future__ import unicode_literals
import errno
from contextlib import contextmanager
import sys
import platform
from . import errors
from six import reraise
_WINDOWS_PLATFORM = platform.system() == 'Windows'
class _ConvertOSErrors(... | en | 0.734712 | Tools for managing OS errors. Context manager to convert OSErrors in to FS Errors. # ENONET #errno.ENOTDIR: errors.DirectoryExpected, # pragma: no cover # pragma: no cover # Stops linter complaining about invalid class name Get a context to map OS errors to their `fs.errors` counterpart. The context will re-write ... | 2.268018 | 2 |
samples/samplenetconf/demos/vr_demo3.py | gaberger/pysdn | 1 | 1114 | <gh_stars>1-10
#!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the ab... | #!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright n... | en | 0.697124 | #!/usr/bin/python # Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notic... | 1.593504 | 2 |
python/index.py | stijnvanhulle/EscapeGame | 1 | 1115 | <gh_stars>1-10
# @Author: <NAME> <stijnvanhulle>
# @Date: 2016-11-28T13:51:38+01:00
# @Email: <EMAIL>
# @Last modified by: stijnvanhulle
# @Last modified time: 2016-12-20T12:51:07+01:00
# @License: stijnvanhulle.be
#!/usr/bin/env python
import time
import datetime
import math
import sys
import json
import paho... | # @Author: <NAME> <stijnvanhulle>
# @Date: 2016-11-28T13:51:38+01:00
# @Email: <EMAIL>
# @Last modified by: stijnvanhulle
# @Last modified time: 2016-12-20T12:51:07+01:00
# @License: stijnvanhulle.be
#!/usr/bin/env python
import time
import datetime
import math
import sys
import json
import paho.mqtt.client as... | en | 0.129851 | # @Author: <NAME> <stijnvanhulle> # @Date: 2016-11-28T13:51:38+01:00 # @Email: <EMAIL> # @Last modified by: stijnvanhulle # @Last modified time: 2016-12-20T12:51:07+01:00 # @License: stijnvanhulle.be #!/usr/bin/env python #classes #client.publish("message",item) #executor = ProcessPoolExecutor(2) #loop = trollius.... | 2.25036 | 2 |
Codility/python/tape_equilibrium.py | ajeet1308/code_problems | 61 | 1116 | def solution(A):
total = sum(A)
m = float('inf')
left_sum = 0
for n in A[:-1]:
left_sum += n
v = abs(total - 2*left_sum)
if v < m:
m = v
return m
| def solution(A):
total = sum(A)
m = float('inf')
left_sum = 0
for n in A[:-1]:
left_sum += n
v = abs(total - 2*left_sum)
if v < m:
m = v
return m
| none | 1 | 3.223895 | 3 | |
peps/converters.py | idjaw/pythondotorg | 0 | 1117 | import re
import os
from bs4 import BeautifulSoup
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from pages.models import Page, Image
PEP_TEMPLATE = 'pages/pep-page.html'
pep_url = lambda num: 'dev/peps/pep-{}/'.format(num)
def check_pat... | import re
import os
from bs4 import BeautifulSoup
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from pages.models import Page, Image
PEP_TEMPLATE = 'pages/pep-page.html'
pep_url = lambda num: 'dev/peps/pep-{}/'.format(num)
def check_pat... | en | 0.802912 | Checks to ensure our PEP_REPO_PATH is setup correctly Take existing generated pep-0000.html and convert to something suitable for a Python.org Page returns the core body HTML necessary only # Grab header and PEP body # Fix PEP links # Skip anything not matching 'pep-XXXX.html' # Remove Version from header Using con... | 2.298364 | 2 |
venv/Lib/site-packages/toolz/sandbox/__init__.py | ajayiagbebaku/NFL-Model | 3,749 | 1118 | from .core import EqualityHashKey, unzip
from .parallel import fold
| from .core import EqualityHashKey, unzip
from .parallel import fold
| none | 1 | 1.150589 | 1 | |
interface/app/__init__.py | caglorithm/accel | 31 | 1119 | from flask import Flask
app = Flask(__name__, static_folder='static')
from app import routes
| from flask import Flask
app = Flask(__name__, static_folder='static')
from app import routes
| none | 1 | 1.570339 | 2 | |
implementations/python3/tests/CAPDU.py | sebastien-riou/SATL | 4 | 1120 | <reponame>sebastien-riou/SATL
import os
import pysatl
from pysatl import CAPDU
if __name__ == "__main__":
def check(hexstr, expected):
capdu = CAPDU.from_hexstr(hexstr)
if capdu != expected:
raise Exception("Mismatch for input '"+hexstr+"'\nActual: "+str(capdu)+"\nExpected: "+str(e... | import os
import pysatl
from pysatl import CAPDU
if __name__ == "__main__":
def check(hexstr, expected):
capdu = CAPDU.from_hexstr(hexstr)
if capdu != expected:
raise Exception("Mismatch for input '"+hexstr+"'\nActual: "+str(capdu)+"\nExpected: "+str(expected))
def gencase(* ... | en | 0.685166 | #check __repr__ #check well formed inputs #check we tolerate less well formed inputs 0x00 0x11 0x22 0x33 | 2.788137 | 3 |
src/mgls_bootstrapping.py | rosich/mgls | 0 | 1121 | <filename>src/mgls_bootstrapping.py
#!/usr/bin/python
from math import sin, cos, tan, atan, pi, acos, sqrt, exp, log10
import sys, os
import copy
import random
import numpy as np
import multiprocessing as mp
import ConfigParser
sys.path.append('./bin')
import mGLS, mMGLS
sys.path.append('./src')
from EnvGlobals import ... | <filename>src/mgls_bootstrapping.py
#!/usr/bin/python
from math import sin, cos, tan, atan, pi, acos, sqrt, exp, log10
import sys, os
import copy
import random
import numpy as np
import multiprocessing as mp
import ConfigParser
sys.path.append('./bin')
import mGLS, mMGLS
sys.path.append('./src')
from EnvGlobals import ... | en | 0.588516 | #!/usr/bin/python #definitions and constants #------------------------- executes n_runs instances of MGLS for with previous data shuffle #shuffle RV's and their errors. Repetition is not allowed comb_rv_err = zip(Globals.rv, Globals.rv_err) random.shuffle(comb_rv_err) Globals.rv[:], Globals.rv_e... | 2.164575 | 2 |
mgmt/src/constants.py | pcaruana/sombrio | 0 | 1122 | #! /usr/bin/env python3
"""
constants.py - Contains all constants used by the device manager
Author:
- <NAME> (<EMAIL> at <EMAIL> dot <EMAIL>)
Date: 12/3/2016
"""
number_of_rows = 3 # total number rows of Index Servers
number_of_links = 5 # number of links to be sent to Cra... | #! /usr/bin/env python3
"""
constants.py - Contains all constants used by the device manager
Author:
- <NAME> (<EMAIL> at <EMAIL> dot <EMAIL>)
Date: 12/3/2016
"""
number_of_rows = 3 # total number rows of Index Servers
number_of_links = 5 # number of links to be sent to Cra... | en | 0.734596 | #! /usr/bin/env python3 constants.py - Contains all constants used by the device manager Author: - <NAME> (<EMAIL> at <EMAIL> dot <EMAIL>) Date: 12/3/2016 # total number rows of Index Servers # number of links to be sent to Crawler # number of chunks to be sent to Index Builder # number of components ma... | 1.237087 | 1 |
XDoG/XDoG.py | STomoya/sketchify | 0 | 1123 | <filename>XDoG/XDoG.py
import cv2
import numpy as np
def DoG(image, size, sigma, k=1.6, gamma=1.):
g1 = cv2.GaussianBlur(image, (size, size), sigma)
g2 = cv2.GaussianBlur(image, (size, size), sigma*k)
return g1 - gamma * g2
def XDoG(image, size, sigma, eps, phi, k=1.6, gamma=1.):
eps /= 255
d = D... | <filename>XDoG/XDoG.py
import cv2
import numpy as np
def DoG(image, size, sigma, k=1.6, gamma=1.):
g1 = cv2.GaussianBlur(image, (size, size), sigma)
g2 = cv2.GaussianBlur(image, (size, size), sigma*k)
return g1 - gamma * g2
def XDoG(image, size, sigma, eps, phi, k=1.6, gamma=1.):
eps /= 255
d = D... | en | 0.924665 | # This config is found by the author # modify if not the desired output # I wanted the gamma between [0.97, 0.98] # but it depends on the image so I made it move randomly # comment out if this is not needed | 2.684853 | 3 |
lm/validate.py | ericlin8545/grover | 864 | 1124 | <reponame>ericlin8545/grover
# Original work Copyright 2018 The Google AI Language Team Authors.
# Modified work Copyright 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | # Original work Copyright 2018 The Google AI Language Team Authors.
# Modified work Copyright 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | en | 0.783596 | # Original work Copyright 2018 The Google AI Language Team Authors. # Modified work Copyright 2019 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/license... | 1.784275 | 2 |
robo/fmin/entropy_search.py | fuhuifang/RoBo | 0 | 1125 | import logging
import george
import numpy as np
from robo.priors.default_priors import DefaultPrior
from robo.models.gaussian_process import GaussianProcess
from robo.models.gaussian_process_mcmc import GaussianProcessMCMC
from robo.maximizers.random_sampling import RandomSampling
from robo.maximizers.scipy_optimizer ... | import logging
import george
import numpy as np
from robo.priors.default_priors import DefaultPrior
from robo.models.gaussian_process import GaussianProcess
from robo.models.gaussian_process_mcmc import GaussianProcessMCMC
from robo.maximizers.random_sampling import RandomSampling
from robo.maximizers.scipy_optimizer ... | en | 0.683414 | Entropy search for global black box optimization problems. This is a reimplemenation of the entropy search algorithm by Henning and Schuler[1]. [1] Entropy search for information-efficient global optimization. <NAME> and <NAME>. JMLR, (1), 2012. Parameters ---------- objective_func... | 2.458465 | 2 |
biserici_inlemnite/app/migrations/0096_bisericapage_datare_an.py | ck-tm/biserici-inlemnite | 0 | 1126 | # Generated by Django 3.1.13 on 2021-10-29 11:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0095_bisericapage_utitle'),
]
operations = [
migrations.AddField(
model_name='bisericapage',
name='datare_an... | # Generated by Django 3.1.13 on 2021-10-29 11:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0095_bisericapage_utitle'),
]
operations = [
migrations.AddField(
model_name='bisericapage',
name='datare_an... | en | 0.85042 | # Generated by Django 3.1.13 on 2021-10-29 11:07 | 1.497283 | 1 |
services/core-api/app/api/mms_now_submissions/models/surface_bulk_sample_activity.py | bcgov/mds | 25 | 1127 | <reponame>bcgov/mds
from app.api.utils.models_mixins import Base
from app.extensions import db
class MMSSurfaceBulkSampleActivity(Base):
__tablename__ = "surface_bulk_sample_activity"
__table_args__ = {"schema": "mms_now_submissions"}
id = db.Column(db.Integer, primary_key=True)
messageid = db.Column(... | from app.api.utils.models_mixins import Base
from app.extensions import db
class MMSSurfaceBulkSampleActivity(Base):
__tablename__ = "surface_bulk_sample_activity"
__table_args__ = {"schema": "mms_now_submissions"}
id = db.Column(db.Integer, primary_key=True)
messageid = db.Column(db.Integer, db.Forei... | none | 1 | 1.944661 | 2 | |
lgtv_rs232/commands/remote_control/remote_control_lock.py | davo22/lgtv_rs232 | 0 | 1128 | from enum import Enum
class RemoteControlLock(Enum):
OFF = 0
ON = 1
def map_to_state(data: int):
return RemoteControlLock(data)
class RemoteControlLockCommands(object):
_command = "km"
def __init__(self, send_command):
self._send_command = send_command
async def get_state(self):
... | from enum import Enum
class RemoteControlLock(Enum):
OFF = 0
ON = 1
def map_to_state(data: int):
return RemoteControlLock(data)
class RemoteControlLockCommands(object):
_command = "km"
def __init__(self, send_command):
self._send_command = send_command
async def get_state(self):
... | none | 1 | 3.102026 | 3 | |
com/bridgelabz/programs/powerof2.py | aashishogale/FunctionalPrograms-Python- | 0 | 1129 | <reponame>aashishogale/FunctionalPrograms-Python-
import sys
from com.bridgelabz.utility.Utility import Utility
class PowerOf2:
def start(self):
number=int(sys.argv[1])
print(number)
for i in Utility().powerof2(number):
print(i)
return
PowerOf2().start() | import sys
from com.bridgelabz.utility.Utility import Utility
class PowerOf2:
def start(self):
number=int(sys.argv[1])
print(number)
for i in Utility().powerof2(number):
print(i)
return
PowerOf2().start() | none | 1 | 2.933378 | 3 | |
app/main.py | MichaelLeeman/Job_Web_Scraper | 0 | 1130 | <filename>app/main.py<gh_stars>0
# This program scraps data from job postings on the website workinstartups.com and appends it to an excel worksheet.
import os
from datetime import datetime, timedelta
from selenium import webdriver
from app import web_scraper
from app import excel
job_list, last_date = [], None
file_... | <filename>app/main.py<gh_stars>0
# This program scraps data from job postings on the website workinstartups.com and appends it to an excel worksheet.
import os
from datetime import datetime, timedelta
from selenium import webdriver
from app import web_scraper
from app import excel
job_list, last_date = [], None
file_... | en | 0.886363 | # This program scraps data from job postings on the website workinstartups.com and appends it to an excel worksheet. # If the Job_Openings workbook already exists then append the jobs not already in the worksheet # by checking the date of the first job in excel, since the last time the site was scraped. # If not, creat... | 3.461639 | 3 |
src/trusted/validator_arm/dgen_output.py | kapkic/native_client | 1 | 1131 | #!/usr/bin/python2
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""
Some common boilerplates and helper functions for source code generation
in files dgen_test_output.py and dgen_decode_out... | #!/usr/bin/python2
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""
Some common boilerplates and helper functions for source code generation
in files dgen_test_output.py and dgen_decode_out... | en | 0.790727 | #!/usr/bin/python2 # # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Some common boilerplates and helper functions for source code generation in files dgen_test_output.py and dgen_decode_output.p... | 2.8079 | 3 |
src/data_loader/input_data_loader.py | ChristopherBrix/Debona | 2 | 1132 |
"""
Functions for loading input data.
Author: <NAME> <<EMAIL>>
"""
import os
import numpy as np
def load_img(path: str, img_nums: list, shape: tuple) -> np.array:
"""
Loads a image in the human-readable format.
Args:
path:
The path to the to the folder with mnist images.
i... |
"""
Functions for loading input data.
Author: <NAME> <<EMAIL>>
"""
import os
import numpy as np
def load_img(path: str, img_nums: list, shape: tuple) -> np.array:
"""
Loads a image in the human-readable format.
Args:
path:
The path to the to the folder with mnist images.
i... | en | 0.778222 | Functions for loading input data. Author: <NAME> <<EMAIL>> Loads a image in the human-readable format. Args: path: The path to the to the folder with mnist images. img_nums: A list with the numbers of the images we want to load. shape: The shape of a sin... | 3.616528 | 4 |
ui_splash_screen.py | hirokiyaginuma/scriptspinner-software | 0 | 1133 | <reponame>hirokiyaginuma/scriptspinner-software
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'splash_screen.ui'
##
## Created by: Qt User Interface Compiler version 5.15.1
##
## WARNING! All changes made in this file wil... | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'splash_screen.ui'
##
## Created by: Qt User Interface Compiler version 5.15.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
############... | de | 0.404131 | # -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'splash_screen.ui' ## ## Created by: Qt User Interface Compiler version 5.15.1 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! #############... | 2.330112 | 2 |
pandas/io/sql.py | danbirken/pandas | 0 | 1134 | <gh_stars>0
"""
Collection of query wrappers / abstractions to both facilitate data
retrieval and to reduce dependency on DB-specific API.
"""
from __future__ import print_function, division
from datetime import datetime, date, timedelta
import warnings
import traceback
import itertools
import re
import numpy as np
i... | """
Collection of query wrappers / abstractions to both facilitate data
retrieval and to reduce dependency on DB-specific API.
"""
from __future__ import print_function, division
from datetime import datetime, date, timedelta
import warnings
import traceback
import itertools
import re
import numpy as np
import pandas... | en | 0.624473 | Collection of query wrappers / abstractions to both facilitate data retrieval and to reduce dependency on DB-specific API. #------------------------------------------------------------------------------ # Helper functions convert sql and params args to DBAPI2.0 compliant format # test if params is a mapping # parse dat... | 2.54294 | 3 |
Dataset/Leetcode/train/58/28.py | kkcookies99/UAST | 0 | 1135 | <filename>Dataset/Leetcode/train/58/28.py
class Solution:
def XXX(self, s):
"""
:type s: str
:rtype: int
"""
cnt, tail = 0, len(s) - 1
while tail >= 0 and s[tail] == ' ':
tail -= 1
while tail >= 0 and s[tail] != ' ':
cnt += 1
... | <filename>Dataset/Leetcode/train/58/28.py
class Solution:
def XXX(self, s):
"""
:type s: str
:rtype: int
"""
cnt, tail = 0, len(s) - 1
while tail >= 0 and s[tail] == ' ':
tail -= 1
while tail >= 0 and s[tail] != ' ':
cnt += 1
... | en | 0.328618 | :type s: str :rtype: int | 2.940262 | 3 |
Systerm/meta.py | ZytroCode/Systerm | 1 | 1136 | <gh_stars>1-10
"""Meta is a module contains objects that will customize the behavior of python."""
from abc import ABC
from abc import ABCMeta
from abc import abstractmethod
from typing import Any
from typing import Callable
import Systerm
# Metaclass
class Metaclass(ABCMeta):
"""A metaclass to customize the beha... | """Meta is a module contains objects that will customize the behavior of python."""
from abc import ABC
from abc import ABCMeta
from abc import abstractmethod
from typing import Any
from typing import Callable
import Systerm
# Metaclass
class Metaclass(ABCMeta):
"""A metaclass to customize the behavior of all cla... | en | 0.515423 | Meta is a module contains objects that will customize the behavior of python. # Metaclass A metaclass to customize the behavior of all classes. The static constructor for the Metaclass. Parameters: name - str The name of the class bases - tuple[type, ...] A tuple of ... | 3.960974 | 4 |
samples/apps/txregulator/tests/txregulatorclient.py | iqsarv/CCF | 1 | 1137 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import infra.e2e_args
import infra.ccf
import infra.jsonrpc
import logging
from time import gmtime, strftime
import csv
import random
from loguru import logger as LOG
class AppUser:
def __init__(self, network, n... | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import infra.e2e_args
import infra.ccf
import infra.jsonrpc
import logging
from time import gmtime, strftime
import csv
import random
from loguru import logger as LOG
class AppUser:
def __init__(self, network, n... | en | 0.929726 | # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache 2.0 License. # read first 10 lines # Manager is granted special privileges by members, which is later read by app to enforce access restrictions return Calls:call( "set_user_data", {{ ... | 2.041264 | 2 |
src/finmag/sim/hysteresis.py | davidcortesortuno/finmag | 10 | 1138 | <reponame>davidcortesortuno/finmag
import os
import re
import glob
import logging
import textwrap
import fileinput
import numpy as np
from finmag.energies import Zeeman
from finmag.util.helpers import norm
log = logging.getLogger(name="finmag")
def hysteresis(sim, H_ext_list, fun=None, **kwargs):
"""
Set the... | import os
import re
import glob
import logging
import textwrap
import fileinput
import numpy as np
from finmag.energies import Zeeman
from finmag.util.helpers import norm
log = logging.getLogger(name="finmag")
def hysteresis(sim, H_ext_list, fun=None, **kwargs):
"""
Set the applied field to the first value i... | en | 0.833246 | Set the applied field to the first value in `H_ext_list` (which should be a list of external field vectors) and then call the relax() method. When convergence is reached, the field is changed to the next one in H_ext_list, and so on until all values in H_ext_list are exhausted. Note: The fields in H_ex... | 2.826969 | 3 |
uiSetup.py | smokedpirate/Encryption-hash-generator | 4 | 1139 | <reponame>smokedpirate/Encryption-hash-generator<gh_stars>1-10
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5 import QtGui, QtCore
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(577, 341)
palette = QtGui... | from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5 import QtGui, QtCore
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(577, 341)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(255, 255, 25... | en | 0.17297 | #333;\n" #fff, stop: 1 #888\n" #fff, stop: 1 #bbb\n" #fff, stop: 1 #ddd\n" #333;\n" #fff, stop: 1 #888\n" #fff, stop: 1 #bbb\n" #fff, stop: 1 #ddd\n" #333;\n" #fff, stop: 1 #888\n" #fff, stop: 1 #bbb\n" #fff, stop: 1 #ddd\n" #333;\n" #fff, stop: 1 #888\n" #fff, stop: 1 #bbb\n" #fff, stop: 1 #ddd\n" | 2.34369 | 2 |
yxtx/myApp/migrations/0017_chat.py | wjh112233/yxtx | 0 | 1140 | # Generated by Django 3.0.2 on 2020-03-17 08:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myApp', '0016_usergroup_buyer'),
]
operations = [
migrations.CreateModel(
name='Chat',
fields=[
('id... | # Generated by Django 3.0.2 on 2020-03-17 08:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myApp', '0016_usergroup_buyer'),
]
operations = [
migrations.CreateModel(
name='Chat',
fields=[
('id... | en | 0.817074 | # Generated by Django 3.0.2 on 2020-03-17 08:44 | 1.970763 | 2 |
core/controllers/services.py | willingc/oh-missions-oppia-beta | 0 | 1141 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | en | 0.853529 | # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ... | 2.377943 | 2 |
convoy/crypto.py | hebinhuang/batch-shipyard | 0 | 1142 | <filename>convoy/crypto.py
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including with... | <filename>convoy/crypto.py
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including with... | en | 0.638519 | # Copyright (c) Microsoft Corporation # # All rights reserved. # # MIT License # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights... | 1.727272 | 2 |
libs/configs/COCO/cfgs_res50_1x_coco_v3.py | lj-ecjtu/Cascade_FPN_Tensorflow-master | 43 | 1143 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import os
import tensorflow as tf
'''
gluoncv backbone + multi_gpu
'''
# ------------------------------------------------
VERSION = 'Cascade_FPN_Res50_COCO_1x_20190421_v3'
NET_NAME = 'resnet50_v1d'
ADD_BOX_IN_TENSORBOARD = True
... | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import os
import tensorflow as tf
'''
gluoncv backbone + multi_gpu
'''
# ------------------------------------------------
VERSION = 'Cascade_FPN_Res50_COCO_1x_20190421_v3'
NET_NAME = 'resnet50_v1d'
ADD_BOX_IN_TENSORBOARD = True
... | en | 0.408131 | # -*- coding: utf-8 -*- gluoncv backbone + multi_gpu # ------------------------------------------------ # ---------------------------------------- System_config # ------------------------------------------ Train config # allow 0~3 # for gluoncv backbone # 2.0 # if None, will not multipy # 10.0 if None, will not clip ... | 2.036271 | 2 |
python/delta/tests/test_exceptions.py | vibhaska/delta | 1 | 1144 | <gh_stars>1-10
#
# Copyright (2020) The Delta Lake Project Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | #
# Copyright (2020) The Delta Lake Project Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | en | 0.848736 | # # Copyright (2020) The Delta Lake Project Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag... | 1.788411 | 2 |
day10/samematrix.py | nikhilsamninan/python-files | 0 | 1145 | def matrix_form():
r = int(input("Enter the no of rows"))
c = int(input("Enter the no of columns"))
matrix=[]
print("Enter the enteries")
for i in range(r):
a = []
for j in range(c):
a.append(int(input()))
matrix.append(a)
return(matrix)
def check_matrix(fi... | def matrix_form():
r = int(input("Enter the no of rows"))
c = int(input("Enter the no of columns"))
matrix=[]
print("Enter the enteries")
for i in range(r):
a = []
for j in range(c):
a.append(int(input()))
matrix.append(a)
return(matrix)
def check_matrix(fi... | none | 1 | 3.928788 | 4 | |
extractFeatures.py | PatrickJReed/Longboard | 1 | 1146 | #!/home/ubuntu/miniconda2/bin/python
from __future__ import division
import sys
import glob, os, gc
import uuid
import os.path
import csv
import numpy as np
from time import time
from subprocess import (call, Popen, PIPE)
from itertools import product
import shutil
import re
import pickle
from boto3.session import Ses... | #!/home/ubuntu/miniconda2/bin/python
from __future__ import division
import sys
import glob, os, gc
import uuid
import os.path
import csv
import numpy as np
from time import time
from subprocess import (call, Popen, PIPE)
from itertools import product
import shutil
import re
import pickle
from boto3.session import Ses... | en | 0.30571 | #!/home/ubuntu/miniconda2/bin/python ##Path to Data | 1.83723 | 2 |
kepler.py | mdbernard/astrodynamics | 0 | 1147 | import numpy as np
from stumpff import C, S
from CelestialBody import BODIES
from numerical import newton, laguerre
from lagrange import calc_f, calc_fd, calc_g, calc_gd
def kepler_chi(chi, alpha, r0, vr0, mu, dt):
''' Kepler's Equation of the universal anomaly, modified
for use in numerical solvers. '''
... | import numpy as np
from stumpff import C, S
from CelestialBody import BODIES
from numerical import newton, laguerre
from lagrange import calc_f, calc_fd, calc_g, calc_gd
def kepler_chi(chi, alpha, r0, vr0, mu, dt):
''' Kepler's Equation of the universal anomaly, modified
for use in numerical solvers. '''
... | en | 0.611174 | Kepler's Equation of the universal anomaly, modified for use in numerical solvers. Derivative of Kepler's Equation of the universal anomaly, modified for use in numerical solvers. Second derivative of Kepler's Equation of the universal anomaly, modified for use in numerical solvers. Solve Kepler's Equation ... | 2.648022 | 3 |
nicos_demo/vpgaa/setups/pgai.py | jkrueger1/nicos | 12 | 1148 | description = 'PGAA setup with XYZOmega sample table'
group = 'basic'
sysconfig = dict(
datasinks = ['mcasink', 'chnsink', 'csvsink', 'livesink']
)
includes = [
'system',
'reactor',
'nl4b',
'pressure',
'sampletable',
'pilz',
'detector',
'collimation',
]
devices = dict(
mcasin... | description = 'PGAA setup with XYZOmega sample table'
group = 'basic'
sysconfig = dict(
datasinks = ['mcasink', 'chnsink', 'csvsink', 'livesink']
)
includes = [
'system',
'reactor',
'nl4b',
'pressure',
'sampletable',
'pilz',
'detector',
'collimation',
]
devices = dict(
mcasin... | en | 0.342694 | SetDetectors('_60p', 'LEGe') SetEnvironment(chamber_pressure) printinfo("============================================================") printinfo("Welcome to the NICOS PGAI demo setup.") printinfo("============================================================") | 1.902809 | 2 |
tests/python/relay/test_op_level2.py | ravikumarvc/incubator-tvm | 3 | 1149 | <gh_stars>1-10
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License")... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | en | 0.835608 | # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u... | 1.850213 | 2 |
official/nlp/transformer/utils/tokenizer_test.py | hjkim-haga/TF-OD-API | 1 | 1150 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | en | 0.873746 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica... | 2.514761 | 3 |
api/api/form7_searching_utils/__init__.py | bcgov/court-of-appeal | 0 | 1151 | <filename>api/api/form7_searching_utils/__init__.py
from .form7_search import Form7Search
from .parse_form7 import Form7Parsing
| <filename>api/api/form7_searching_utils/__init__.py
from .form7_search import Form7Search
from .parse_form7 import Form7Parsing
| none | 1 | 1.094404 | 1 | |
soil/build/lib/soil/openstack/snapshot.py | JackDan9/soil | 1 | 1152 | <gh_stars>1-10
# Copyright 2020 Soil, Inc.
from soil.openstack.base import DataBase
from soil.openstack.base import SourceBase
class SnapshotData(DataBase):
"""A class for openstack snapshot data"""
def __init__(self, data):
self.data = data['snapshot']
class Snapshot(SourceBase):
"""A cla... | # Copyright 2020 Soil, Inc.
from soil.openstack.base import DataBase
from soil.openstack.base import SourceBase
class SnapshotData(DataBase):
"""A class for openstack snapshot data"""
def __init__(self, data):
self.data = data['snapshot']
class Snapshot(SourceBase):
"""A class for openstac... | en | 0.726999 | # Copyright 2020 Soil, Inc. A class for openstack snapshot data A class for openstack snapshot | 2.319534 | 2 |
Z - Tool Box/LaZagne/Windows/lazagne/softwares/windows/ppypykatz.py | dfirpaul/Active-Directory-Exploitation-Cheat-Sheet-1 | 1,290 | 1153 | # -*- coding: utf-8 -*-
# Thanks to @skelsec for his awesome tool Pypykatz
# Checks his project here: https://github.com/skelsec/pypykatz
import codecs
import traceback
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
from pypykatz.pypykatz import pypykatz
... | # -*- coding: utf-8 -*-
# Thanks to @skelsec for his awesome tool Pypykatz
# Checks his project here: https://github.com/skelsec/pypykatz
import codecs
import traceback
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
from pypykatz.pypykatz import pypykatz
... | en | 0.888334 | # -*- coding: utf-8 -*- # Thanks to @skelsec for his awesome tool Pypykatz # Checks his project here: https://github.com/skelsec/pypykatz Pypykatz dumps all secrets from the lsass.exe memory
It does not work if:
- LSASS is running as a protected process
- A security product blocks this access # Right now... | 2.086086 | 2 |
test/test_discogs.py | mglukhovsky/beets | 0 | 1154 | <filename>test/test_discogs.py
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, <NAME>.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including... | <filename>test/test_discogs.py
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, <NAME>.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including... | en | 0.84084 | # -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, <NAME>. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the right... | 2.354238 | 2 |
data_structures/queue/queue_on_pseudo_stack.py | hank-chou/python | 13 | 1155 | <filename>data_structures/queue/queue_on_pseudo_stack.py
"""Queue represented by a pseudo stack (represented by a list with pop and append)"""
class Queue:
def __init__(self):
self.stack = []
self.length = 0
def __str__(self):
printed = "<" + str(self.stack)[1:-1] + ">"
return... | <filename>data_structures/queue/queue_on_pseudo_stack.py
"""Queue represented by a pseudo stack (represented by a list with pop and append)"""
class Queue:
def __init__(self):
self.stack = []
self.length = 0
def __str__(self):
printed = "<" + str(self.stack)[1:-1] + ">"
return... | en | 0.780697 | Queue represented by a pseudo stack (represented by a list with pop and append) Enqueues {@code item} @param item item to enqueue Dequeues {@code item} @requirement: |self.length| > 0 @return dequeued item that was dequeued Rotates the queue {@code rotation} times @param rotation ... | 4.190721 | 4 |
darknet2ncnn.py | nihui/gen-ncnn-models | 4 | 1156 | <reponame>nihui/gen-ncnn-models
#! /usr/bin/env python
# coding: utf-8
import configparser
import numpy as np
import re,sys,os
from graph import MyGraph
from collections import OrderedDict
def unique_config_sections(config_file):
"""Convert all config sections to have unique names.
Adds unique suffixes to co... | #! /usr/bin/env python
# coding: utf-8
import configparser
import numpy as np
import re,sys,os
from graph import MyGraph
from collections import OrderedDict
def unique_config_sections(config_file):
"""Convert all config sections to have unique names.
Adds unique suffixes to config sections for compability wi... | en | 0.685679 | #! /usr/bin/env python # coding: utf-8 Convert all config sections to have unique names. Adds unique suffixes to config sections for compability with configparser. #print('find filters for ', name) # read out major, minor, revision, net.seen # record the output of the original layer # this section will can be a su... | 2.578202 | 3 |
music/models.py | anirudha-bs/Django_music_app | 0 | 1157 | from django.contrib.auth.models import Permission, User
from django.db import models
class Album(models.Model):
user = models.ForeignKey(User, default=1,on_delete=models.CASCADE)
artist = models.CharField(max_length=250)
album_title = models.CharField(max_length=500)
genre = models.CharField(max_lengt... | from django.contrib.auth.models import Permission, User
from django.db import models
class Album(models.Model):
user = models.ForeignKey(User, default=1,on_delete=models.CASCADE)
artist = models.CharField(max_length=250)
album_title = models.CharField(max_length=500)
genre = models.CharField(max_lengt... | none | 1 | 2.517056 | 3 | |
finex_history.py | yihming/gdax-data | 0 | 1158 | <filename>finex_history.py
import datetime
import calendar
import requests
import pandas as pd
import json
import os.path
import time
import MySQLdb as M
from gdax_history import timestamp_to_utcstr
def connect_to_db():
config = json.load(open('dbconn.json'))["mysql"]
db = M.connect(host = config["host"],
... | <filename>finex_history.py
import datetime
import calendar
import requests
import pandas as pd
import json
import os.path
import time
import MySQLdb as M
from gdax_history import timestamp_to_utcstr
def connect_to_db():
config = json.load(open('dbconn.json'))["mysql"]
db = M.connect(host = config["host"],
... | en | 0.680283 | INSERT INTO finex_history (timestamp, open, close, high, low, volume, utc_datetime) VALUES (%s, %s, %s, %s, %s, %s, %s) #because bitstamp only allows 10 requests per minute. Take rest if we are faster than that #60*60*24*30 #30 days at a time #if the time is in future. #1 hour can be changed to any time... | 2.566546 | 3 |
src/producers/connector.py | cvelas31/public_transportation_streaming | 0 | 1159 | """Configures a Kafka Connector for Postgres Station data"""
import json
import logging
import requests
from settings import Settings
logger = logging.getLogger(__name__)
KAFKA_CONNECT_URL = f"{Settings.URLs.KAFKA_CONNECT_URL}/connectors"
CONNECTOR_NAME = "stations"
def configure_connector():
"""Starts and co... | """Configures a Kafka Connector for Postgres Station data"""
import json
import logging
import requests
from settings import Settings
logger = logging.getLogger(__name__)
KAFKA_CONNECT_URL = f"{Settings.URLs.KAFKA_CONNECT_URL}/connectors"
CONNECTOR_NAME = "stations"
def configure_connector():
"""Starts and co... | en | 0.849351 | Configures a Kafka Connector for Postgres Station data Starts and configures the Kafka Connect connector # Poll every 5 seconds # TODO: Complete the Kafka Connect Config below. # Directions: Use the JDBC Source Connector to connect to Postgres. Load the `stations` table # using incrementing mode, with `stop_id` as the ... | 3.107116 | 3 |
liuetal2019/utils.py | wasiahmad/GATE | 24 | 1160 | import io
import logging
import json
import numpy
import torch
import numpy as np
from tqdm import tqdm
from clie.inputters import constant
from clie.objects import Sentence
from torch.utils.data import Dataset
from torch.utils.data.sampler import Sampler
logger = logging.getLogger(__name__)
def load_word_embeddings... | import io
import logging
import json
import numpy
import torch
import numpy as np
from tqdm import tqdm
from clie.inputters import constant
from clie.objects import Sentence
from torch.utils.data import Dataset
from torch.utils.data.sampler import Sampler
logger = logging.getLogger(__name__)
def load_word_embeddings... | en | 0.517552 | # ------------------------------------------------------------------------------ # Data loading # ------------------------------------------------------------------------------ # we swap the start and end index # we swap the start and end index # store KNN word info Torchify a single example. Gather a batch of individu... | 2.315411 | 2 |
build.py | dnanexus/IndexTools | 15 | 1161 | from distutils.extension import Extension
cmdclass = {}
try:
# with Cython
from Cython.Build import build_ext
cmdclass["build_ext"] = build_ext
module_src = "cgranges/python/cgranges.pyx"
except ImportError: # without Cython
module_src = "cgranges/python/cgranges.c"
def build(setup_kwargs):
... | from distutils.extension import Extension
cmdclass = {}
try:
# with Cython
from Cython.Build import build_ext
cmdclass["build_ext"] = build_ext
module_src = "cgranges/python/cgranges.pyx"
except ImportError: # without Cython
module_src = "cgranges/python/cgranges.c"
def build(setup_kwargs):
... | en | 0.897979 | # with Cython # without Cython This function is mandatory in order to build the extensions. | 1.954328 | 2 |
icarus/models/service/__init__.py | oascigil/icarus_edge_comp | 5 | 1162 | <filename>icarus/models/service/__init__.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from .compSpot import *
| <filename>icarus/models/service/__init__.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from .compSpot import *
| en | 0.769321 | # -*- coding: utf-8 -*- | 1.026889 | 1 |
gluoncv/data/kinetics400/classification.py | YvetteGuo/gluon-cv | 1 | 1163 | <reponame>YvetteGuo/gluon-cv<filename>gluoncv/data/kinetics400/classification.py
# pylint: disable=line-too-long,too-many-lines,missing-docstring
"""Kinetics400 action classification dataset."""
import os
import random
import numpy as np
from mxnet import nd
from mxnet.gluon.data import dataset
__all__ = ['Kinetics400... | # pylint: disable=line-too-long,too-many-lines,missing-docstring
"""Kinetics400 action classification dataset."""
import os
import random
import numpy as np
from mxnet import nd
from mxnet.gluon.data import dataset
__all__ = ['Kinetics400']
class Kinetics400(dataset.Dataset):
"""Load the Kinetics400 action recogn... | en | 0.68642 | # pylint: disable=line-too-long,too-many-lines,missing-docstring Kinetics400 action classification dataset. Load the Kinetics400 action recognition dataset. Refer to :doc:`../build/examples_datasets/kinetics400` for the description of this dataset and how to prepare it. Parameters ---------- root ... | 2.847334 | 3 |
qf_lib/containers/futures/future_contract.py | webclinic017/qf-lib | 198 | 1164 | # Copyright 2016-present CERN – European Organization for Nuclear Research
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | # Copyright 2016-present CERN – European Organization for Nuclear Research
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | en | 0.811226 | # Copyright 2016-present CERN – European Organization for Nuclear Research # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2... | 2.428384 | 2 |
watcher/api/controllers/v1/action_plan.py | ajaytikoo/watcher | 64 | 1165 | <reponame>ajaytikoo/watcher
# -*- encoding: utf-8 -*-
# Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | # -*- encoding: utf-8 -*-
# Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | en | 0.828513 | # -*- encoding: utf-8 -*- # Copyright 2013 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re... | 1.643022 | 2 |
controllers/albums.py | jeonginlee/groove_scheduler | 0 | 1166 | <reponame>jeonginlee/groove_scheduler
from flask import *
albums = Blueprint('albums', __name__, template_folder='templates')
@albums.route('/albums/edit')
def albums_edit_route():
options = {
"edit": True
}
return render_template("albums.html", **options)
@albums.route('/albums')
def albums_route():
options ... | from flask import *
albums = Blueprint('albums', __name__, template_folder='templates')
@albums.route('/albums/edit')
def albums_edit_route():
options = {
"edit": True
}
return render_template("albums.html", **options)
@albums.route('/albums')
def albums_route():
options = {
"edit": False
}
return render_... | none | 1 | 2.292245 | 2 | |
Incident-Response/Tools/dfirtrack/dfirtrack_main/views/division_views.py | sn0b4ll/Incident-Playbook | 1 | 1167 | <filename>Incident-Response/Tools/dfirtrack/dfirtrack_main/views/division_views.py
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect, render
from django.urls import reverse
from django.views.generic import DetailView, ListView
from django... | <filename>Incident-Response/Tools/dfirtrack/dfirtrack_main/views/division_views.py
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect, render
from django.urls import reverse
from django.views.generic import DetailView, ListView
from django... | none | 1 | 1.947143 | 2 | |
run.py | shark803/Torch_serve_example_NLP | 1 | 1168 | # coding: UTF-8
import time
import torch
import numpy as np
from train_eval import train, init_network
from importlib import import_module
import argparse
parser = argparse.ArgumentParser(description='Chinese Text Classification')
parser.add_argument('--model', type=str, required=True, help='choose a model: TextCNN')
... | # coding: UTF-8
import time
import torch
import numpy as np
from train_eval import train, init_network
from importlib import import_module
import argparse
parser = argparse.ArgumentParser(description='Chinese Text Classification')
parser.add_argument('--model', type=str, required=True, help='choose a model: TextCNN')
... | zh | 0.193287 | # coding: UTF-8 # 数据集 # 搜狗新闻:embedding_SougouNews.npz, 腾讯:embedding_Tencent.npz, 随机初始化:random # embedding = 'random' # TextCNN # 保证每次结果一样 # train | 2.500318 | 3 |
src/tests/cfp/views/test_cfp_user.py | xhub/pretalx | 0 | 1169 | <filename>src/tests/cfp/views/test_cfp_user.py
import pytest
from django.conf import settings
from django.core import mail as djmail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.urls import reverse
from django_scopes import scope
from rest_framework.authtoken.models import Token
from preta... | <filename>src/tests/cfp/views/test_cfp_user.py
import pytest
from django.conf import settings
from django.core import mail as djmail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.urls import reverse
from django_scopes import scope
from rest_framework.authtoken.models import Token
from preta... | none | 1 | 1.975083 | 2 | |
tests/mb_util.py | vasilydenisenko/modbus_rtu_slave | 0 | 1170 | <reponame>vasilydenisenko/modbus_rtu_slave
# MIT License
# Copyright (c) 2021 <NAME>, <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without lim... | # MIT License
# Copyright (c) 2021 <NAME>, <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | en | 0.742845 | # MIT License # Copyright (c) 2021 <NAME>, <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, p... | 1.526145 | 2 |
modules/stackoverflow/models.py | tjsavage/polymer-dashboard | 1 | 1171 | <gh_stars>1-10
import fix_path
import json
import datetime
from google.appengine.ext import ndb
# Taken from http://stackoverflow.com/questions/455580/json-datetime-between-python-and-javascript
dthandler = lambda obj: (
obj.isoformat()
if isinstance(obj, datetime.datetime)
or isinstance(obj, datetime.dat... | import fix_path
import json
import datetime
from google.appengine.ext import ndb
# Taken from http://stackoverflow.com/questions/455580/json-datetime-between-python-and-javascript
dthandler = lambda obj: (
obj.isoformat()
if isinstance(obj, datetime.datetime)
or isinstance(obj, datetime.date)
else Non... | en | 0.65502 | # Taken from http://stackoverflow.com/questions/455580/json-datetime-between-python-and-javascript Example Model | 2.525431 | 3 |
src/main/java/com/bailei/study/beautyOfCoding/cpu50.py | sonymoon/algorithm | 0 | 1172 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import time
busyTime = 10
idleTime = busyTime
while True:
start = time.clock()
while time.clock() - start < busyTime:
pass
time.sleep(busyTime / 1000)
| #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import time
busyTime = 10
idleTime = busyTime
while True:
start = time.clock()
while time.clock() - start < busyTime:
pass
time.sleep(busyTime / 1000)
| fr | 0.316442 | #!/usr/bin/python3 # -*- coding: UTF-8 -*- | 3.316322 | 3 |
carto/maps.py | danicarrion/carto-python | 85 | 1173 | """
Module for working with named and anonymous maps
.. module:: carto.maps
:platform: Unix, Windows
:synopsis: Module for working with named and anonymous maps
.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME> <<EMAIL>>
"""
try:
from urllib.parse import urljoin
except ImportError:
from url... | """
Module for working with named and anonymous maps
.. module:: carto.maps
:platform: Unix, Windows
:synopsis: Module for working with named and anonymous maps
.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME> <<EMAIL>>
"""
try:
from urllib.parse import urljoin
except ImportError:
from url... | en | 0.675316 | Module for working with named and anonymous maps .. module:: carto.maps :platform: Unix, Windows :synopsis: Module for working with named and anonymous maps .. moduleauthor:: <NAME> <<EMAIL>> .. moduleauthor:: <NAME> <<EMAIL>> Base class for NamedMap and AnonymousMap Initializes a BaseMap instance :para... | 3.124538 | 3 |
client_driver.py | tlagore/kv_store | 0 | 1174 | from kv_client.kv_client import KVClient
def main():
kvSlave = KVClient(1, "127.0.0.1", 3456)
kvSlave.start()
if __name__ == "__main__":
main() | from kv_client.kv_client import KVClient
def main():
kvSlave = KVClient(1, "127.0.0.1", 3456)
kvSlave.start()
if __name__ == "__main__":
main() | none | 1 | 1.388564 | 1 | |
pytorch-frontend/benchmarks/operator_benchmark/pt/embeddingbag_test.py | AndreasKaratzas/stonne | 206 | 1175 | <reponame>AndreasKaratzas/stonne<filename>pytorch-frontend/benchmarks/operator_benchmark/pt/embeddingbag_test.py
import operator_benchmark as op_bench
import torch
import numpy
from . import configs
"""EmbeddingBag Operator Benchmark"""
class EmbeddingBagBenchmark(op_bench.TorchBenchmarkBase):
def init(self, embe... | import operator_benchmark as op_bench
import torch
import numpy
from . import configs
"""EmbeddingBag Operator Benchmark"""
class EmbeddingBagBenchmark(op_bench.TorchBenchmarkBase):
def init(self, embeddingbags, dim, mode, input_size, offset, sparse, include_last_offset, device):
self.embedding = torch.nn... | en | 0.215736 | EmbeddingBag Operator Benchmark | 2.435499 | 2 |
python/dgl/geometry/capi.py | lfchener/dgl | 9,516 | 1176 | """Python interfaces to DGL farthest point sampler."""
from dgl._ffi.base import DGLError
import numpy as np
from .._ffi.function import _init_api
from .. import backend as F
from .. import ndarray as nd
def _farthest_point_sampler(data, batch_size, sample_points, dist, start_idx, result):
r"""Farthest Point Samp... | """Python interfaces to DGL farthest point sampler."""
from dgl._ffi.base import DGLError
import numpy as np
from .._ffi.function import _init_api
from .. import backend as F
from .. import ndarray as nd
def _farthest_point_sampler(data, batch_size, sample_points, dist, start_idx, result):
r"""Farthest Point Samp... | en | 0.784978 | Python interfaces to DGL farthest point sampler. Farthest Point Sampler Parameters ---------- data : tensor A tensor of shape (N, d) where N is the number of points and d is the dimension. batch_size : int The number of batches in the ``data``. N should be divisible by batch_size. s... | 2.196099 | 2 |
scidb/core/data.py | oxdc/sci.db | 0 | 1177 | import shutil
import hashlib
from pathlib import Path
from typing import TextIO, BinaryIO, IO, Union
from datetime import datetime
from os.path import getmtime
from .low import ObservableDict
class Data:
def __init__(self, data_name: str, parent, bucket,
protected_parent_methods: Union[None, dict... | import shutil
import hashlib
from pathlib import Path
from typing import TextIO, BinaryIO, IO, Union
from datetime import datetime
from os.path import getmtime
from .low import ObservableDict
class Data:
def __init__(self, data_name: str, parent, bucket,
protected_parent_methods: Union[None, dict... | none | 1 | 2.327362 | 2 | |
tensorflow/python/keras/optimizer_v2/optimizer_v2.py | PaulWang1905/tensorflow | 9 | 1178 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | en | 0.778962 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica... | 1.615827 | 2 |
escola/teste_get.py | danielrosendos/djangoRestFramework | 2 | 1179 | <filename>escola/teste_get.py
import requests
headers = {
'content-type': 'application/json',
'Authorization': 'Token <PASSWORD>'
}
url_base_cursos = 'http://127.0.0.1:8000/api/v2/cursos'
url_base_avaliacoes = 'http://127.0.0.1:8000/api/v2/avaliacoes'
resultado = requests.get(url=url_base_cursos, headers=hea... | <filename>escola/teste_get.py
import requests
headers = {
'content-type': 'application/json',
'Authorization': 'Token <PASSWORD>'
}
url_base_cursos = 'http://127.0.0.1:8000/api/v2/cursos'
url_base_avaliacoes = 'http://127.0.0.1:8000/api/v2/avaliacoes'
resultado = requests.get(url=url_base_cursos, headers=hea... | none | 1 | 2.574695 | 3 | |
python/avi/sdk/utils/waf_policy/vdi_waf_policy.py | aaronjwood/alb-sdk | 0 | 1180 | <gh_stars>0
# Copyright 2021 VMware, Inc.
import argparse
import json
import re
import logging
import os
import sys
from avi.sdk.avi_api import ApiSession
API_VERSION = "18.2.13"
SYSTEM_WAF_POLICY_VDI='System-WAF-Policy-VDI'
logger = logging.getLogger(__name__)
def add_allowlist_rule(waf_policy_obj):
#add a al... | # Copyright 2021 VMware, Inc.
import argparse
import json
import re
import logging
import os
import sys
from avi.sdk.avi_api import ApiSession
API_VERSION = "18.2.13"
SYSTEM_WAF_POLICY_VDI='System-WAF-Policy-VDI'
logger = logging.getLogger(__name__)
def add_allowlist_rule(waf_policy_obj):
#add a allowlist rule... | en | 0.883539 | # Copyright 2021 VMware, Inc. #add a allowlist rule to allow request with uri beginning with /ice/ #disable response side rules and some specific rules #add a rule to parse body as xml for requests with /broker/xml uri | 2.345506 | 2 |
src/api/bkuser_core/tests/bkiam/test_constants.py | Chace-wang/bk-user | 0 | 1181 | <reponame>Chace-wang/bk-user
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file exce... | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | en | 0.84359 | # -*- coding: utf-8 -*- TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License... | 1.822885 | 2 |
votesim/benchmarks/__init__.py | johnh865/election_sim | 8 | 1182 | <filename>votesim/benchmarks/__init__.py
# from votesim.benchmarks.benchrunner import (
# run_benchmark,
# get_benchmarks,
# post_benchmark,
# plot_benchmark,
# )
from votesim.benchmarks import runtools, simple | <filename>votesim/benchmarks/__init__.py
# from votesim.benchmarks.benchrunner import (
# run_benchmark,
# get_benchmarks,
# post_benchmark,
# plot_benchmark,
# )
from votesim.benchmarks import runtools, simple | en | 0.581737 | # from votesim.benchmarks.benchrunner import ( # run_benchmark, # get_benchmarks, # post_benchmark, # plot_benchmark, # ) | 1.11844 | 1 |
src/handler.py | MrIgumnov96/ETL-CloudDeployment | 0 | 1183 | import boto3
import src.app as app
import csv
import psycopg2 as ps
import os
from dotenv import load_dotenv
load_dotenv()
dbname = os.environ["db"]
host = os.environ["host"]
port = os.environ["port"]
user = os.environ["user"]
password = os.environ["pass"]
connection = ps.connect(dbname=dbname,
... | import boto3
import src.app as app
import csv
import psycopg2 as ps
import os
from dotenv import load_dotenv
load_dotenv()
dbname = os.environ["db"]
host = os.environ["host"]
port = os.environ["port"]
user = os.environ["user"]
password = os.environ["pass"]
connection = ps.connect(dbname=dbname,
... | en | 0.404067 | # Get key and bucket informaition # use boto3 library to get object from S3 # read CSV # csv_data = csv.reader(data.splitlines()) # for row in csv_data: # datestr = row[0] #.replace('/', '-') # # print(datestr) # date_obj = datetime.strptime(datestr, '%d/%m/%Y %H:%M') # # print(date_obj) # # tim... | 2.443232 | 2 |
improver_tests/precipitation_type/test_utilities.py | cpelley/improver | 77 | 1184 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | en | 0.731568 | # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a... | 1.470071 | 1 |
app/api/v1/models/items.py | bryan-munene/Store-Manager-DB | 0 | 1185 | from .db_conn import ModelSetup
class ItemsModel(ModelSetup):
'''Handles the data logic of the items section'''
def __init__(
self,
name=None,
price=None,
quantity=None,
category_id=None,
reorder_point=None,
auth=None):
... | from .db_conn import ModelSetup
class ItemsModel(ModelSetup):
'''Handles the data logic of the items section'''
def __init__(
self,
name=None,
price=None,
quantity=None,
category_id=None,
reorder_point=None,
auth=None):
... | en | 0.606225 | Handles the data logic of the items section Initializes the variables for the items class Adds item given the above arguements. Then returns the created item INSERT INTO items(name, price, quantity, image, category, reorder_point, created_by)\ VALUES(%s,%s,%s,%s,%s,%s,%s); SELECT * FROM items WHERE name... | 3.214884 | 3 |
site/src/sphinx/_extensions/api.py | linxGnu/armeria | 0 | 1186 | <reponame>linxGnu/armeria
from docutils.parsers.rst.roles import register_canonical_role, set_classes
from docutils.parsers.rst import directives
from docutils import nodes
from sphinx.writers.html import HTMLTranslator
from sphinx.errors import ExtensionError
import os
import re
def api_role(role, rawtext, text, li... | from docutils.parsers.rst.roles import register_canonical_role, set_classes
from docutils.parsers.rst import directives
from docutils import nodes
from sphinx.writers.html import HTMLTranslator
from sphinx.errors import ExtensionError
import os
import re
def api_role(role, rawtext, text, lineno, inliner, options={},... | en | 0.683285 | # Build the mappings from a simple class name to its Javadoc file. # Ignore the non-class files. We rely on the simple assumption that # a class name always starts with an upper-case English alphabet. # FQCN or package name. # Package # Class # Simple class name; find from the pre-calculated mappings. # Prepend the fra... | 2.229958 | 2 |
feaas/runners/__init__.py | tsuru/varnishapi | 3 | 1187 | # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import time
from feaas import storage
class Base(object):
def __init__(self, manager, interval, *locks):
self.manager = manager
self.st... | # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import time
from feaas import storage
class Base(object):
def __init__(self, manager, interval, *locks):
self.manager = manager
self.st... | en | 0.911255 | # Copyright 2014 varnishapi authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. | 2.351029 | 2 |
ros_buildfarm/debian_repo.py | j-rivero/ros_buildfarm | 0 | 1188 | # Copyright 2014 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | # Copyright 2014 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | en | 0.844857 | # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law... | 2.016917 | 2 |
player.py | Drayux/Battlematus | 0 | 1189 | # PLAYER
class player:
def __init__(self):
| # PLAYER
class player:
def __init__(self):
| none | 1 | 1.687878 | 2 | |
Framwork-Backpropagation/utils/utils_v2.py | ConvolutedDog/Implicit-Im2col-for-Backpropagation | 0 | 1190 | # Copyright 2022 ConvolutedDog (https://github.com/ConvolutedDog/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | # Copyright 2022 ConvolutedDog (https://github.com/ConvolutedDog/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | en | 0.471562 | # Copyright 2022 ConvolutedDog (https://github.com/ConvolutedDog/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required... | 2.257741 | 2 |
ark_nlp/factory/utils/attack.py | yubuyuabc/ark-nlp | 1 | 1191 | <gh_stars>1-10
import torch
class FGM(object):
"""
基于FGM算法的攻击机制
Args:
module (:obj:`torch.nn.Module`): 模型
Examples::
>>> # 初始化
>>> fgm = FGM(module)
>>> for batch_input, batch_label in data:
>>> # 正常训练
>>> loss = module(batch_input, batch_labe... | import torch
class FGM(object):
"""
基于FGM算法的攻击机制
Args:
module (:obj:`torch.nn.Module`): 模型
Examples::
>>> # 初始化
>>> fgm = FGM(module)
>>> for batch_input, batch_label in data:
>>> # 正常训练
>>> loss = module(batch_input, batch_label)
>>> ... | zh | 0.266095 | 基于FGM算法的攻击机制 Args: module (:obj:`torch.nn.Module`): 模型 Examples:: >>> # 初始化 >>> fgm = FGM(module) >>> for batch_input, batch_label in data: >>> # 正常训练 >>> loss = module(batch_input, batch_label) >>> loss.backward() # 反向传播,得到正常的grad >... | 3.19224 | 3 |
core.py | sreejithr/deepfake | 0 | 1192 | import cv2
import torch
import yaml
import imageio
import throttle
import numpy as np
import matplotlib.pyplot as plt
from argparse import ArgumentParser
from skimage.transform import resize
from scipy.spatial import ConvexHull
from modules.generator import OcclusionAwareGenerator
from modules.keypoint_detector import... | import cv2
import torch
import yaml
import imageio
import throttle
import numpy as np
import matplotlib.pyplot as plt
from argparse import ArgumentParser
from skimage.transform import resize
from scipy.spatial import ConvexHull
from modules.generator import OcclusionAwareGenerator
from modules.keypoint_detector import... | en | 0.206021 | #from animate import normalize_kp # command = [ffmpeg, # '-y', # '-f', 'rawvideo', # '-vcodec','rawvideo', # '-pix_fmt', 'bgr24', # '-s', dimension, # '-i', '-', # '-c:v', 'libx264', # '-pix_fmt', 'yuv420p', # '-preset', 'ultrafast', # '-f', 'flv', # 'rtmp://10.10.10.80/live/... | 1.729161 | 2 |
soupy/approximations/taylor/backup/__init__.py | cpempire/soupy | 1 | 1193 | <reponame>cpempire/soupy<gh_stars>1-10
from __future__ import absolute_import, division, print_function
from .controlPDEProblem import ControlPDEProblem
from .controlPDEProblemMultiPDE import ControlPDEProblemMultiPDE
from .costFunctionalConstant import CostFunctionalConstant
from .costFunctionalConstantMultiPDE impor... | from __future__ import absolute_import, division, print_function
from .controlPDEProblem import ControlPDEProblem
from .controlPDEProblemMultiPDE import ControlPDEProblemMultiPDE
from .costFunctionalConstant import CostFunctionalConstant
from .costFunctionalConstantMultiPDE import CostFunctionalConstantMultiPDE
from .... | en | 0.809304 | # from .chanceConstraintQuadratic import ChanceConstraintQuadratic # from .chanceConstraintLinear import ChanceConstraintLinear # from .chanceConstraintConstant import ChanceConstraintConstant # to do list # 0. implement zero, Hessian term # 1. implement linear # 2. implement quadratic # 3. impelement SAA # to do list ... | 1.735807 | 2 |
models/1-Tom/train/kaggle-hubmap-main/src/02_train/transforms.py | navekshasood/HuBMAP---Hacking-the-Kidney | 0 | 1194 | import numpy as np
from albumentations import (Compose, HorizontalFlip, VerticalFlip, Rotate, RandomRotate90,
ShiftScaleRotate, ElasticTransform,
GridDistortion, RandomSizedCrop, RandomCrop, CenterCrop,
RandomBrightnessContrast, HueSatu... | import numpy as np
from albumentations import (Compose, HorizontalFlip, VerticalFlip, Rotate, RandomRotate90,
ShiftScaleRotate, ElasticTransform,
GridDistortion, RandomSizedCrop, RandomCrop, CenterCrop,
RandomBrightnessContrast, HueSatu... | en | 0.689418 | #Basic #Morphology #Color | 1.845685 | 2 |
cubspack/geometry.py | Majikat/cubspack | 11 | 1195 | <gh_stars>10-100
# -*- coding: utf-8 -*-
from math import sqrt
class Point(object):
__slots__ = ('x', 'y', 'z')
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def __eq__(self, other):
return (self.x == other.x and self.y == other.y and self.z == other.z)
... | # -*- coding: utf-8 -*-
from math import sqrt
class Point(object):
__slots__ = ('x', 'y', 'z')
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def __eq__(self, other):
return (self.x == other.x and self.y == other.y and self.z == other.z)
def __repr__... | en | 0.765701 | # -*- coding: utf-8 -*- Calculate distance to another point Arguments: start (Point): Segment start point end (Point): Segment end point Faster than length and useful for some comparisons Horizontal Segment Create an Horizontal segment given its left most end point and its length. Argu... | 3.907783 | 4 |
app/recipe/tests/test_recipe_api.py | tahmadvand/recipe_app_api | 0 | 1196 | <reponame>tahmadvand/recipe_app_api
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
# use that for making our API requests
from core.models import Recipe, Tag, Ingredient
from .... | from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
# use that for making our API requests
from core.models import Recipe, Tag, Ingredient
from ..serializers import RecipeSerializer... | en | 0.918364 | # use that for making our API requests # allows you to call a function which will then create a temp file # somewhere in the system and then you can remove that file after # you've used it # this allows us to perform things like # creating path names and also checking if files exist on the system # pillow, this will im... | 2.710384 | 3 |
Assignment 1 n 2 Day 8.py | paju3125/LetsUpgrade-Python-B7 | 0 | 1197 | <gh_stars>0
# Assignment 1 Day 8
# write a decorator function for taking input for you
# any kind of function you want to build
def getInput(calculate_arg_fuc):
def wrap_function():
print("Enter two numbers ")
a=int(input("Enter first number = "))
b=int(input("Enter second numbe... | # Assignment 1 Day 8
# write a decorator function for taking input for you
# any kind of function you want to build
def getInput(calculate_arg_fuc):
def wrap_function():
print("Enter two numbers ")
a=int(input("Enter first number = "))
b=int(input("Enter second number = "))
... | en | 0.866762 | # Assignment 1 Day 8 # write a decorator function for taking input for you # any kind of function you want to build # Assignment 2 day 8 # you need to develop a python program to open a file in read only mode and # try writing something to it and handlethe subsequent errorusing Exception Handling | 4.133236 | 4 |
gwcs/coordinate_frames.py | migueldvb/gwcs | 0 | 1198 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Defines coordinate frames and ties them to data axes.
"""
from __future__ import absolute_import, division, unicode_literals, print_function
import numpy as np
from astropy import units as u
from astropy import utils as astutil
from astropy import coo... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Defines coordinate frames and ties them to data axes.
"""
from __future__ import absolute_import, division, unicode_literals, print_function
import numpy as np
from astropy import units as u
from astropy import utils as astutil
from astropy import coo... | en | 0.468798 | # Licensed under a 3-clause BSD style license - see LICENSE.rst Defines coordinate frames and ties them to data axes. Base class for CoordinateFrames. Parameters ---------- naxes : int Number of axes. axes_type : str One of ["SPATIAL", "SPECTRAL", "TIME"] axes_order : tuple of int ... | 2.827928 | 3 |
modox/chan_modifier.py | lukpazera/modox | 11 | 1199 |
import lx
import modo
import select
import item
from run import run
class ChannelModifierUtils(object):
@classmethod
def attachModifierToItem(cls, modifierModoItem, hostModoItem):
"""
Allows for attaching modifier to locator type item.
Attached item will show up under the locator ... |
import lx
import modo
import select
import item
from run import run
class ChannelModifierUtils(object):
@classmethod
def attachModifierToItem(cls, modifierModoItem, hostModoItem):
"""
Allows for attaching modifier to locator type item.
Attached item will show up under the locator ... | en | 0.771365 | Allows for attaching modifier to locator type item. Attached item will show up under the locator item in item list (you can unfold it with a little plus icons next to item name in item list). Attached modifiers are getting deleted together with locator they are attached to. Parameters ... | 2.665314 | 3 |