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
qlearn.py
vyom1911/Q_learning_game
1
6631651
<reponame>vyom1911/Q_learning_game<gh_stars>1-10 #!/usr/bin/env python from __future__ import print_function import argparse import skimage as skimage from skimage import transform, color, exposure from skimage.transform import rotate from skimage.viewer import ImageViewer import sys sys.path.append("game/") import wr...
#!/usr/bin/env python from __future__ import print_function import argparse import skimage as skimage from skimage import transform, color, exposure from skimage.transform import rotate from skimage.viewer import ImageViewer import sys sys.path.append("game/") import wrapped_flappy_bird as game import random import nu...
en
0.809686
#!/usr/bin/env python # the name of the game being played for log files # number of valid actions # decay rate of past observations # timesteps to observe before training # frames over which to anneal epsilon # final value of epsilon # starting value of epsilon # number of previous transitions to remember # size of min...
2.5336
3
cdhweb/people/tests/conftest.py
bwhicks/cdh-web
1
6631652
<filename>cdhweb/people/tests/conftest.py from datetime import date, timedelta import pytest from cdhweb.pages.models import RelatedLinkType from cdhweb.pages.tests.conftest import to_streamfield_safe from cdhweb.people.models import ( PeopleLandingPage, Person, PersonRelatedLink, Position, Profil...
<filename>cdhweb/people/tests/conftest.py from datetime import date, timedelta import pytest from cdhweb.pages.models import RelatedLinkType from cdhweb.pages.tests.conftest import to_streamfield_safe from cdhweb.people.models import ( PeopleLandingPage, Person, PersonRelatedLink, Position, Profil...
en
0.927932
factory method to create person with position for fixtures Create a test people landing page underneath the homepage. fixture to create a staff person with two staff positions # give the staffer a second position fixture to create a postdoc person fixture to create a student person record Create a grad student person w...
2.206507
2
hackerrank-python/np-min-and-max.py
fmelihh/competitive-programming-solutions
2
6631653
# https://www.hackerrank.com/challenges//problem import numpy if __name__ == '__main__': N, M = map(int, input().split()) arr = list() for _ in range(N): arr.append(list(map(int, input().split()))) numpy_arr = numpy.array(arr) min_elements = numpy.min(arr, axis = 1) ...
# https://www.hackerrank.com/challenges//problem import numpy if __name__ == '__main__': N, M = map(int, input().split()) arr = list() for _ in range(N): arr.append(list(map(int, input().split()))) numpy_arr = numpy.array(arr) min_elements = numpy.min(arr, axis = 1) ...
en
0.524992
# https://www.hackerrank.com/challenges//problem
3.553104
4
cwe_relation_cve/cwe_mitre_scrapper.py
pawlaczyk/sarenka_tools
3
6631654
from typing import List, Dict from bs4 import BeautifulSoup import requests import re class CWEMitreScraper: cwe_mitre_url = "https://cwe.mitre.org/data/definitions/" def __init__(self, id_cwe: str): if "-" in id_cwe: id_cwe = id_cwe.split("-")[1] # dla postaci CWE-79 self.id_cwe...
from typing import List, Dict from bs4 import BeautifulSoup import requests import re class CWEMitreScraper: cwe_mitre_url = "https://cwe.mitre.org/data/definitions/" def __init__(self, id_cwe: str): if "-" in id_cwe: id_cwe = id_cwe.split("-")[1] # dla postaci CWE-79 self.id_cwe...
pl
0.980958
# dla postaci CWE-79 Zwraca tytuł slabości. # bez duplikatow - wydajniej zamienic na slwonik Poziom prawdopodobieństwa istnienia exploitów i samej exploitacji słabości. Poziom prawdopodobieństwa istnienia exploitów i samej exploitacji słabości. Częsre konswekwencje exploitacji słabości. # be zpierwszego wiersza bo tam ...
2.956787
3
testsuite/test_cint4c1e.py
Minyan910/libcint
0
6631655
<reponame>Minyan910/libcint #!/usr/bin/env python # $Id$ # -*- coding: utf-8 ''' test libcint ''' __author__ = "<NAME> <<EMAIL>>" import sys import os import ctypes import numpy _cint = numpy.ctypeslib.load_library('libcint', '.') PTR_LIGHT_SPEED = 0 PTR_COMMON_ORIG = 1 PTR_SHIELDING_ORIG = 4 PTR_RINV_ORIG ...
#!/usr/bin/env python # $Id$ # -*- coding: utf-8 ''' test libcint ''' __author__ = "<NAME> <<EMAIL>>" import sys import os import ctypes import numpy _cint = numpy.ctypeslib.load_library('libcint', '.') PTR_LIGHT_SPEED = 0 PTR_COMMON_ORIG = 1 PTR_SHIELDING_ORIG = 4 PTR_RINV_ORIG = 4 PTR_RINV_ZETA ...
en
0.49638
#!/usr/bin/env python # $Id$ # -*- coding: utf-8 test libcint # basis with kappa > 0 # basis with kappa < 0 #intor = _cint.cint4c1e_sph
1.957984
2
polyglotjsonnlp/__init__.py
dcavar/Polyglot-JSON-NLP
4
6631656
#!/usr/bin/env python3 """ (C) 2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> Wrappers for Polyglot to JSON-NLP output format. Licensed under the Apache License 2.0, see the file LICENSE for more details. Brought to you by the NLP-Lab.org (https://nlp-lab.org/)! """ import functools from collections import Ord...
#!/usr/bin/env python3 """ (C) 2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> Wrappers for Polyglot to JSON-NLP output format. Licensed under the Apache License 2.0, see the file LICENSE for more details. Brought to you by the NLP-Lab.org (https://nlp-lab.org/)! """ import functools from collections import Ord...
en
0.702827
#!/usr/bin/env python3 (C) 2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> Wrappers for Polyglot to JSON-NLP output format. Licensed under the Apache License 2.0, see the file LICENSE for more details. Brought to you by the NLP-Lab.org (https://nlp-lab.org/)! A decorator to cache function response based on param...
2.729683
3
online_recommend/user_portrait/user_tohive.py
hfhfn/db_recommend
0
6631657
from user_portrait.merge_action import get_merge_action from user_portrait.pre_user import merge_user_data, get_pre_table, pre_user_data from user_portrait.user_profile import get_action_topic_sort, get_action_weight, get_action_topic_weight, \ get_user_profile, normal_action_weight from utils.default import user_p...
from user_portrait.merge_action import get_merge_action from user_portrait.pre_user import merge_user_data, get_pre_table, pre_user_data from user_portrait.user_profile import get_action_topic_sort, get_action_weight, get_action_topic_weight, \ get_user_profile, normal_action_weight from utils.default import user_p...
zh
0.586154
保存用户点击数据 3873, 15328, 69706, 48092, 54080, 73413, 92161, 115959, 164695, 119800, 131214, 133817, 156526 156044, 168976, 209320, 247980, 275296, 271935, 318472, 369976, 394286 保存用户收藏数据 50, 357, 1748, 666, 893, 1247, 1307, 1650, 2095, 1544, 1691, 1835, 1940 2153, 2093, 3477, 3027, ...
1.984988
2
rebuild.py
vazrupe/fake-og-server
0
6631658
<filename>rebuild.py import re from urllib.request import urlopen from urllib.parse import urljoin from bs4 import BeautifulSoup open_graph_rgx = re.compile('^og:(?P<meta>.+)') html_template = ''' <html> <head> {og_tags} <title>{title}</title> <meta http-equiv="refresh" content="0; {target_url}" /> ...
<filename>rebuild.py import re from urllib.request import urlopen from urllib.parse import urljoin from bs4 import BeautifulSoup open_graph_rgx = re.compile('^og:(?P<meta>.+)') html_template = ''' <html> <head> {og_tags} <title>{title}</title> <meta http-equiv="refresh" content="0; {target_url}" /> ...
en
0.14399
<html> <head> {og_tags} <title>{title}</title> <meta http-equiv="refresh" content="0; {target_url}" /> </head> </html>
2.806633
3
credoscript/models/groove.py
tlb-lab/credoscript
0
6631659
from sqlalchemy.orm import backref, relationship from credoscript import Base, schema from credoscript.mixins import PathMixin class Groove(Base, PathMixin): """ Class representing a Groove entity from CREDO. A groove is a binary interaction between a polypeptide and a oligonucleotide chain (DNA/RNA/Hybri...
from sqlalchemy.orm import backref, relationship from credoscript import Base, schema from credoscript.mixins import PathMixin class Groove(Base, PathMixin): """ Class representing a Groove entity from CREDO. A groove is a binary interaction between a polypeptide and a oligonucleotide chain (DNA/RNA/Hybri...
en
0.743052
Class representing a Groove entity from CREDO. A groove is a binary interaction between a polypeptide and a oligonucleotide chain (DNA/RNA/Hybrid). Attributes ---------- Mapped Attributes ----------------- Returns all the Contacts that are formed between the two Chains of this Interface. ...
2.662284
3
api/endpoints/projects/languageProject.py
mshen63/DevUp
2
6631660
<filename>api/endpoints/projects/languageProject.py from flask import Blueprint, jsonify, request from models.models import db, ProjectModel, RelProjectLanguage, LanguageModel languageProject_api = Blueprint("languageProject_api", __name__) @languageProject_api.route("/addProjectLanguage", methods=("POST",)) def ad...
<filename>api/endpoints/projects/languageProject.py from flask import Blueprint, jsonify, request from models.models import db, ProjectModel, RelProjectLanguage, LanguageModel languageProject_api = Blueprint("languageProject_api", __name__) @languageProject_api.route("/addProjectLanguage", methods=("POST",)) def ad...
none
1
2.88957
3
asset_name_versioning.py
uom-daris/mflux-python-utilities
0
6631661
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Jan 27 10:00:41 2017 @author: jwinton """ import mfclient import mf_connect from xml.sax.saxutils import escape """ A python module that renames mediaflux assets and copies the name metadata to a versioned metadata chunk """ def set_mf_name(namespa...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Jan 27 10:00:41 2017 @author: jwinton """ import mfclient import mf_connect from xml.sax.saxutils import escape """ A python module that renames mediaflux assets and copies the name metadata to a versioned metadata chunk """ def set_mf_name(namespa...
en
0.514374
#!/usr/bin/env python2 # -*- coding: utf-8 -*- Created on Fri Jan 27 10:00:41 2017 @author: jwinton A python module that renames mediaflux assets and copies the name metadata to a versioned metadata chunk # Create a mediaflux connection # mfcommand = "asset.query :where namespace>="+namespace+" and (xpath(asset/name) ...
2.135174
2
isi_sdk_8_2_0/isi_sdk_8_2_0/models/cloud_settings_settings_cloud_policy_defaults.py
mohitjain97/isilon_sdk_python
24
6631662
<reponame>mohitjain97/isilon_sdk_python # coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 7 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six ...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 7 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from isi_sdk_8_2_0.models.cloud_settings...
en
0.608972
# coding: utf-8 Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 7 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git # noqa: F401 # noqa: F401,E501 NOTE: This class is auto generated by the swagger code generator program. ...
1.307963
1
app/run.py
EFerriss/playful
1
6631663
<filename>app/run.py #!/user/bin/python from playful import app app.run(debug = True)
<filename>app/run.py #!/user/bin/python from playful import app app.run(debug = True)
en
0.310673
#!/user/bin/python
1.264139
1
tests/targets/nester.py
Laufire/ec
2
6631664
<reponame>Laufire/ec<gh_stars>1-10 """ nester ====== Used to test nested modules. """ from ec.ec import member, task import simple member(simple) # add the imported member to the script @task def task1(): print 'task1'
""" nester ====== Used to test nested modules. """ from ec.ec import member, task import simple member(simple) # add the imported member to the script @task def task1(): print 'task1'
en
0.737827
nester ====== Used to test nested modules. # add the imported member to the script
2.656942
3
MachineLearning/week2/ransac_demo.py
fengjixuchui/EmbeddedSystem
228
6631665
<reponame>fengjixuchui/EmbeddedSystem # Ransac many noisy data import numpy as np import matplotlib.pyplot as plt import random SIZE = 50 ERROR = 50 x = np.linspace(0, 10, SIZE) y = 3 * x + 10 random_x = [x[i] + random.uniform(-0.6, 0.2) for i in range(SIZE)] random_y = [y[i] + random.uniform(-0.6, 0.2) for i in ra...
# Ransac many noisy data import numpy as np import matplotlib.pyplot as plt import random SIZE = 50 ERROR = 50 x = np.linspace(0, 10, SIZE) y = 3 * x + 10 random_x = [x[i] + random.uniform(-0.6, 0.2) for i in range(SIZE)] random_y = [y[i] + random.uniform(-0.6, 0.2) for i in range(SIZE)] # add some error points fo...
zh
0.307043
# Ransac many noisy data # add some error points # fig = plt.figure() # ax1 = fig.add_subplot(1, 1, 1) # ax1.scatter(RANDOM_X, RANDOM_Y) # plt.show() # use OLS to fit the model # from sklearn.linear_model import LinearRegression # # data_X = RANDOM_X.reshape(-1, 1) # data_Y = RANDOM_Y.reshape(-1, 1) # # reg = LinearRe...
3.599449
4
Lib/site-packages/asn1crypto/cms.py
ldepaula3/TextAnalyticsApp
0
6631666
<filename>Lib/site-packages/asn1crypto/cms.py # coding: utf-8 """ ASN.1 type classes for cryptographic message syntax (CMS). Structures are also compatible with PKCS#7. Exports the following items: - AuthenticatedData() - AuthEnvelopedData() - CompressedData() - ContentInfo() - DigestedData() - Encry...
<filename>Lib/site-packages/asn1crypto/cms.py # coding: utf-8 """ ASN.1 type classes for cryptographic message syntax (CMS). Structures are also compatible with PKCS#7. Exports the following items: - AuthenticatedData() - AuthEnvelopedData() - CompressedData() - ContentInfo() - DigestedData() - Encry...
en
0.688955
# coding: utf-8 ASN.1 type classes for cryptographic message syntax (CMS). Structures are also compatible with PKCS#7. Exports the following items: - AuthenticatedData() - AuthEnvelopedData() - CompressedData() - ContentInfo() - DigestedData() - EncryptedData() - EnvelopedData() - SignedAndEnvelopedD...
2.238328
2
web/apps/web_copo/copo_middleware/__init__.py
rpatil524/COPO
16
6631667
<reponame>rpatil524/COPO<gh_stars>10-100 __author__ = '<EMAIL> - 29/04/2016'
__author__ = '<EMAIL> - 29/04/2016'
none
1
1.102319
1
packages/pyre/constraints/Between.py
rtburns-jpl/pyre
0
6631668
# -*- coding: utf-8 -*- # # <NAME> # orthologue # (c) 1998-2020 all rights reserved # # superclass from .Constraint import Constraint # declaration class Between(Constraint): """ Given {a} and {b} from a set with an ordering principle, this constraint is satisfied if the candidate is in {(a,b)} """ ...
# -*- coding: utf-8 -*- # # <NAME> # orthologue # (c) 1998-2020 all rights reserved # # superclass from .Constraint import Constraint # declaration class Between(Constraint): """ Given {a} and {b} from a set with an ordering principle, this constraint is satisfied if the candidate is in {(a,b)} """ ...
en
0.759562
# -*- coding: utf-8 -*- # # <NAME> # orthologue # (c) 1998-2020 all rights reserved # # superclass # declaration Given {a} and {b} from a set with an ordering principle, this constraint is satisfied if the candidate is in {(a,b)} # interface Check whether {candidate} satisfies this constraint # if {candidate} is be...
3.415673
3
notebooks/connectfour-withMinmax.py
nilutz/Connectfour
1
6631669
<reponame>nilutz/Connectfour<filename>notebooks/connectfour-withMinmax.py # coding: utf-8 # In[1]: import numpy as np # In[2]: class Minmax(object): ''' This is a simple MinMax algorithm with score-Hashing and Alpha Beta pruning. The score evaluates a heuristic. ''' DIC ={} ...
# coding: utf-8 # In[1]: import numpy as np # In[2]: class Minmax(object): ''' This is a simple MinMax algorithm with score-Hashing and Alpha Beta pruning. The score evaluates a heuristic. ''' DIC ={} def __init__(self): #load a DIC with some precalculated va...
en
0.741092
# coding: utf-8 # In[1]: # In[2]: This is a simple MinMax algorithm with score-Hashing and Alpha Beta pruning. The score evaluates a heuristic. #load a DIC with some precalculated values values save a data object loads a data object This function creates a hashkey for a board so it can be stored in the dictionary. ...
3.527331
4
RLBotPack/Manticore/behaviour/save_goal.py
FootlessQuill54/RLBotPack
0
6631670
<gh_stars>0 from rlbot.agents.base_agent import SimpleControllerState from controllers.aim_cone import AimCone from strategy.objective import Objective from strategy.utility_system import UtilityState from utility import predict from utility.info import Ball, Goal from utility.rlmath import sign, clip from utility.vec...
from rlbot.agents.base_agent import SimpleControllerState from controllers.aim_cone import AimCone from strategy.objective import Objective from strategy.utility_system import UtilityState from utility import predict from utility.info import Ball, Goal from utility.rlmath import sign, clip from utility.vec import Vec3...
none
1
2.416946
2
rnaseq_report/modules/rnaseq_post_alignment_qc/post_alignment_qc.py
yqsongGitHub/rnaseq-report
0
6631671
#!/usr/bin/env python """ RnaSeqReport plugin module """ from __future__ import print_function from collections import defaultdict, OrderedDict import logging import os import re from multiqc import config from multiqc.modules.base_module import BaseMultiqcModule from multiqc.plots import bargraph, linegraph, table ...
#!/usr/bin/env python """ RnaSeqReport plugin module """ from __future__ import print_function from collections import defaultdict, OrderedDict import logging import os import re from multiqc import config from multiqc.modules.base_module import BaseMultiqcModule from multiqc.plots import bargraph, linegraph, table ...
en
0.841989
#!/usr/bin/env python RnaSeqReport plugin module # Initialise the logger Qualimap is really a collection of separate programs: BamQC, RNASeq and Counts.. This module is split into separate files to reflect this and help with code organisation. # Initialise the parent object # Initialise the submodules # Set up ...
2.360645
2
src_rl_group/load_npy.py
icdm2021submission/Continual-Neural-Network-Model-Retraining
0
6631672
<filename>src_rl_group/load_npy.py import numpy as np num_classes = 10 depth = 1#mnist is 1, cifar-10 is 3 shape=(5, 5, -1, 32) array_weights1_1 = np.load('cluster_array_weights1_1.npy') array_weights1_1 = np.reshape(array_weights1_1, shape) print(array_weights1_1.shape) np.save('cluster_array_weights1_1', array_weig...
<filename>src_rl_group/load_npy.py import numpy as np num_classes = 10 depth = 1#mnist is 1, cifar-10 is 3 shape=(5, 5, -1, 32) array_weights1_1 = np.load('cluster_array_weights1_1.npy') array_weights1_1 = np.reshape(array_weights1_1, shape) print(array_weights1_1.shape) np.save('cluster_array_weights1_1', array_weig...
en
0.963504
#mnist is 1, cifar-10 is 3
2.722361
3
argoverse/data_loading/argoverse_forecasting_loader.py
alliecc/argoverse-api
1
6631673
<filename>argoverse/data_loading/argoverse_forecasting_loader.py # <Copyright 2019, Argo AI, LLC. Released under the MIT license.> import os from functools import lru_cache from pathlib import Path from typing import Any, Mapping, Optional, Sequence, Union import numpy as np import pandas as pd __all__ = ["ArgoverseF...
<filename>argoverse/data_loading/argoverse_forecasting_loader.py # <Copyright 2019, Argo AI, LLC. Released under the MIT license.> import os from functools import lru_cache from pathlib import Path from typing import Any, Mapping, Optional, Sequence, Union import numpy as np import pandas as pd __all__ = ["ArgoverseF...
en
0.683257
# <Copyright 2019, Argo AI, LLC. Released under the MIT license.> A caching CSV reader Args: path: Path to the csv file *args, **kwargs: optional arguments to be used while data loading Returns: pandas DataFrame containing the loaded csv Initialization function for the class. ...
2.830554
3
searchableencryption/hve/hierarchicalencoding.py
duykienvp/searchableencryption
0
6631674
""" HVE with hierarchical encoding. Section 3.2 of 'An Efficient Privacy-Preserving System for Monitoring Mobile Users: Making Searchable Encryption Practical' Link: https://dl.acm.org/citation.cfm?id=2557559 """ def encode_cell_id(dim: int, row: int, col: int) -> list: """ Get hierarchical encoding binary repre...
""" HVE with hierarchical encoding. Section 3.2 of 'An Efficient Privacy-Preserving System for Monitoring Mobile Users: Making Searchable Encryption Practical' Link: https://dl.acm.org/citation.cfm?id=2557559 """ def encode_cell_id(dim: int, row: int, col: int) -> list: """ Get hierarchical encoding binary repre...
en
0.726501
HVE with hierarchical encoding. Section 3.2 of 'An Efficient Privacy-Preserving System for Monitoring Mobile Users: Making Searchable Encryption Practical' Link: https://dl.acm.org/citation.cfm?id=2557559 Get hierarchical encoding binary representation of cell (row, col) with the grid of dim x dim. See Section 3.2...
3.147599
3
src/project/project.py
memnoth/gtkworkshop
0
6631675
<filename>src/project/project.py # project.py from gi.repository import Gtk from .MyHeaderBar import MyHeaderBar from .MyMainBox import MyMainBox class MyTextEditor(Gtk.Window): def __init__(self): Gtk.Window.__init__(self) self.headerbar = MyHeaderBar() self.set_titlebar(se...
<filename>src/project/project.py # project.py from gi.repository import Gtk from .MyHeaderBar import MyHeaderBar from .MyMainBox import MyMainBox class MyTextEditor(Gtk.Window): def __init__(self): Gtk.Window.__init__(self) self.headerbar = MyHeaderBar() self.set_titlebar(se...
en
0.339168
# project.py
2.226879
2
src/models/modules/__init__.py
takedarts/DenseResNet
0
6631676
from .blurpool import BlurPool2d from .dropblock import DropBlock from .reshape import ChannelPad, Reshape from .selective_kernel import SKConv2d from .semodule import SEModule from .shakedrop import ShakeDrop from .sigmoid import HSigmoid from .signal_augmentation import SignalAugmentation from .split_attentio...
from .blurpool import BlurPool2d from .dropblock import DropBlock from .reshape import ChannelPad, Reshape from .selective_kernel import SKConv2d from .semodule import SEModule from .shakedrop import ShakeDrop from .sigmoid import HSigmoid from .signal_augmentation import SignalAugmentation from .split_attentio...
none
1
1.001956
1
resources/lib/services/playback/am_playback.py
mediabrasiltv/plugin.video.netflix
0
6631677
# -*- coding: utf-8 -*- """ Copyright (C) 2017 <NAME> (plugin.video.netflix) Copyright (C) 2019 Smeulf (original implementation module) Operations for changing the playback status SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ from __future__ import absolute_import, divi...
# -*- coding: utf-8 -*- """ Copyright (C) 2017 <NAME> (plugin.video.netflix) Copyright (C) 2019 Smeulf (original implementation module) Operations for changing the playback status SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ from __future__ import absolute_import, divi...
en
0.796462
# -*- coding: utf-8 -*- Copyright (C) 2017 <NAME> (plugin.video.netflix) Copyright (C) 2019 Smeulf (original implementation module) Operations for changing the playback status SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. Operations for changing the playback status # Due to a b...
2.451215
2
infrastructure/uxas/setup.py
VVCAS-Sean/OpenUxAS
88
6631678
<filename>infrastructure/uxas/setup.py """Module setup for uxas infrastructure.""" from setuptools import setup, find_packages install_requires = [ "e3-core", "e3-testsuite", "pyzmq", ] setup( name="uxas", version=0.1, url="https://github.com/afrl-rq/OpenUxAS", licence="GLPv3", author=...
<filename>infrastructure/uxas/setup.py """Module setup for uxas infrastructure.""" from setuptools import setup, find_packages install_requires = [ "e3-core", "e3-testsuite", "pyzmq", ] setup( name="uxas", version=0.1, url="https://github.com/afrl-rq/OpenUxAS", licence="GLPv3", author=...
en
0.534133
Module setup for uxas infrastructure.
1.315597
1
code/python/FactSetOwnershipReportBuilder/v1/fds/sdk/FactSetOwnershipReportBuilder/models/__init__.py
factset/enterprise-sdk
6
6631679
<reponame>factset/enterprise-sdk<filename>code/python/FactSetOwnershipReportBuilder/v1/fds/sdk/FactSetOwnershipReportBuilder/models/__init__.py # flake8: noqa # import all models into this package # if you have many models here with many references from one model to another this may # raise a RecursionError # to avoid...
# flake8: noqa # import all models into this package # if you have many models here with many references from one model to another this may # raise a RecursionError # to avoid this, import only the models that you directly need like: # from from fds.sdk.FactSetOwnershipReportBuilder.model.pet import Pet # or import th...
en
0.808077
# flake8: noqa # import all models into this package # if you have many models here with many references from one model to another this may # raise a RecursionError # to avoid this, import only the models that you directly need like: # from from fds.sdk.FactSetOwnershipReportBuilder.model.pet import Pet # or import thi...
1.729609
2
smaregipy/entities/account.py
shabaraba/SmaregiPy
0
6631680
<reponame>shabaraba/SmaregiPy import datetime import pytz from typing import Optional class Account(): def __init__( self: 'Account', contract_id: str, sub: Optional[str]=None, is_owner: Optional[bool]=False, access_token: Optional[str]=None, access_token_expiration_...
import datetime import pytz from typing import Optional class Account(): def __init__( self: 'Account', contract_id: str, sub: Optional[str]=None, is_owner: Optional[bool]=False, access_token: Optional[str]=None, access_token_expiration_datetime: Optional[datetime.da...
ja
0.999982
有効期限を過ぎていないかどうか確認します
2.991499
3
pytest_localstack/__init__.py
Andrew-Wichmann/pytest-localstack
63
6631681
<reponame>Andrew-Wichmann/pytest-localstack<filename>pytest_localstack/__init__.py import contextlib import logging import sys import docker import pytest from pytest_localstack import plugin, session, utils _start_timeout = None _stop_timeout = None def pytest_configure(config): global _start_timeout, _stop...
import contextlib import logging import sys import docker import pytest from pytest_localstack import plugin, session, utils _start_timeout = None _stop_timeout = None def pytest_configure(config): global _start_timeout, _stop_timeout _start_timeout = config.getoption("--localstack-start-timeout") _s...
en
0.699688
Hook to add pytest_localstack command line options to pytest. Create a pytest fixture that provides a LocalstackSession. This is not a fixture! It is a factory to create them. The fixtures that are created by this function will yield a :class:`.LocalstackSession` instance. This is useful for simulatin...
2.322824
2
api/app/data/tweets.py
biancarosa/emotion_analysis
0
6631682
"""Deals with HealthCheck route.""" import os import logging import base64 import requests from flask import jsonify logging.basicConfig(level=logging.DEBUG) def get_user_tweets(): """Returns last 1000 user tweets""" screen_name = '__biancarosa' consumer_key = os.getenv('TWITTER_CONSUMER_KEY') consum...
"""Deals with HealthCheck route.""" import os import logging import base64 import requests from flask import jsonify logging.basicConfig(level=logging.DEBUG) def get_user_tweets(): """Returns last 1000 user tweets""" screen_name = '__biancarosa' consumer_key = os.getenv('TWITTER_CONSUMER_KEY') consum...
en
0.64122
Deals with HealthCheck route. Returns last 1000 user tweets
2.62496
3
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/teams/views.py
osoco/better-ways-of-thinking-about-software
3
6631683
<reponame>osoco/better-ways-of-thinking-about-software """ HTTP endpoints for the Teams API. """ import logging from collections import Counter from django.conf import settings from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.core.exceptions import Permissio...
""" HTTP endpoints for the Teams API. """ import logging from collections import Counter from django.conf import settings from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.core.exceptions import PermissionDenied from django.db.models.signals import post_save ...
en
0.887511
HTTP endpoints for the Teams API. # lint-amnesty, pylint: disable=imported-auth-user # pylint: disable=unused-argument Emits signal after the team is saved. # Don't emit events when we are first creating the team. Paginate topics. Paginate the user's teams. View methods related to the teams dashboard. Renders the teams...
1.623611
2
python/ray/data/tests/test_optimize.py
dsctt/ray
0
6631684
<reponame>dsctt/ray import pytest import pandas as pd import os import ray from ray.data.context import DatasetContext from ray.data.datasource.csv_datasource import CSVDatasource from ray.tests.conftest import * # noqa def expect_stages(pipe, num_stages_expected, stage_names): stats = pipe.stats() for nam...
import pytest import pandas as pd import os import ray from ray.data.context import DatasetContext from ray.data.datasource.csv_datasource import CSVDatasource from ray.tests.conftest import * # noqa def expect_stages(pipe, num_stages_expected, stage_names): stats = pipe.stats() for name in stage_names: ...
en
0.918434
# noqa # Re-read on. # Re-read off.
2.177351
2
run.py
leiyue/microblog
0
6631685
<gh_stars>0 #!env/Scripts/python # -*- coding: utf-8 -*- # @Date : 2016-01-21 12:36 # @Author : leiyue (<EMAIL>) # @Link : https://leiyue.wordpress.com/ from app import app app.run()
#!env/Scripts/python # -*- coding: utf-8 -*- # @Date : 2016-01-21 12:36 # @Author : leiyue (<EMAIL>) # @Link : https://leiyue.wordpress.com/ from app import app app.run()
en
0.32384
#!env/Scripts/python # -*- coding: utf-8 -*- # @Date : 2016-01-21 12:36 # @Author : leiyue (<EMAIL>) # @Link : https://leiyue.wordpress.com/
1.076668
1
setup.py
markreidvfx/pyavb
21
6631686
<gh_stars>10-100 import sys import os from setuptools import setup import setuptools.command.build_py from distutils.extension import Extension PROJECT_METADATA = { "version": "0.1.0.dev2", "author": '<NAME>', "author_email": '<EMAIL>', "license": 'MIT', } METADATA_TEMPLATE = """ __version__ = "{versi...
import sys import os from setuptools import setup import setuptools.command.build_py from distutils.extension import Extension PROJECT_METADATA = { "version": "0.1.0.dev2", "author": '<NAME>', "author_email": '<EMAIL>', "license": 'MIT', } METADATA_TEMPLATE = """ __version__ = "{version}" __author__ =...
en
0.63826
__version__ = "{version}" __author__ = "{author}" __author_email__ = "{author_email}" __license__ = "{license}" Stamps PROJECT_METADATA into __init__ files. # get the base data from the original file # write that + the suffix to the target file
2.007316
2
poky-dunfell/meta/lib/oeqa/selftest/cases/imagefeatures.py
lacie-life/YoctoPi
0
6631687
# # SPDX-License-Identifier: MIT # from oeqa.selftest.case import OESelftestTestCase from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu from oeqa.utils.sshcontrol import SSHControl import os import json class ImageFeatures(OESelftestTestCase): test_user = 'tester' root_user = 'root' de...
# # SPDX-License-Identifier: MIT # from oeqa.selftest.case import OESelftestTestCase from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu from oeqa.utils.sshcontrol import SSHControl import os import json class ImageFeatures(OESelftestTestCase): test_user = 'tester' root_user = 'root' de...
en
0.665616
# # SPDX-License-Identifier: MIT # Summary: Check if non root user can connect via ssh without password Expected: 1. Connection to the image via ssh using root user without providing a password should be allowed. 2. Connection to the image via ssh using tester user without providing a password...
2.398176
2
pyamg/aggregation/__init__.py
Alexey-Voronin/pyamg-1
0
6631688
<reponame>Alexey-Voronin/pyamg-1<gh_stars>0 """Aggregation-based AMG""" from .adaptive import * from .aggregate import * from .aggregation import * from .tentative import * from .smooth import * from .rootnode import * __all__ = [s for s in dir() if not s.startswith('_')]
"""Aggregation-based AMG""" from .adaptive import * from .aggregate import * from .aggregation import * from .tentative import * from .smooth import * from .rootnode import * __all__ = [s for s in dir() if not s.startswith('_')]
en
0.889414
Aggregation-based AMG
1.314104
1
src/azure-cli/azure/cli/command_modules/appconfig/commands.py
xaliciayang/azure-cli
4
6631689
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
en
0.467525
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
1.729493
2
nw_products/app/api.py
mateifl/microdjango
0
6631690
<filename>nw_products/app/api.py from tastypie.resources import ModelResource, ALL_WITH_RELATIONS from tastypie import fields from tastypie.authorization import Authorization from app.models import Product, Category, Supplier class CategoryResource(ModelResource): class Meta: queryset = Category.objects.a...
<filename>nw_products/app/api.py from tastypie.resources import ModelResource, ALL_WITH_RELATIONS from tastypie import fields from tastypie.authorization import Authorization from app.models import Product, Category, Supplier class CategoryResource(ModelResource): class Meta: queryset = Category.objects.a...
none
1
2.153564
2
indel_prediction/model_testing/test_model.py
kaskamal/SelfTarget
20
6631691
import pandas as pd import numpy as np import random from mpi4py import MPI import io, os, sys, csv, time from multiprocessing import Process, Pipe from scipy.stats import pearsonr, spearmanr from sklearn.model_selection import KFold from sklearn import metrics from selftarget.data import getSampleSelectors, getAl...
import pandas as pd import numpy as np import random from mpi4py import MPI import io, os, sys, csv, time from multiprocessing import Process, Pipe from scipy.stats import pearsonr, spearmanr from sklearn.model_selection import KFold from sklearn import metrics from selftarget.data import getSampleSelectors, getAl...
en
0.876216
#Check final training result with lambda=0
1.932912
2
quaternion_calc/__init__.py
dhaystead/Quaternion
0
6631692
import quaternion_calc.util from quaternion_calc.quat import Quaternion
import quaternion_calc.util from quaternion_calc.quat import Quaternion
none
1
1.195639
1
MeshToolkit/File/Obj.py
microy/MeshToolkit
4
6631693
<reponame>microy/MeshToolkit # -*- coding:utf-8 -*- # # Import OBJ files # # External dependencies import os import numpy as np import MeshToolkit as mtk # Import a mesh from a OBJ / SMF file def ReadObj( filename ) : # Initialisation vertices = [] faces = [] normals = [] colors = [] texcoords = [] material =...
# -*- coding:utf-8 -*- # # Import OBJ files # # External dependencies import os import numpy as np import MeshToolkit as mtk # Import a mesh from a OBJ / SMF file def ReadObj( filename ) : # Initialisation vertices = [] faces = [] normals = [] colors = [] texcoords = [] material = "" # Read each line in the ...
en
0.636067
# -*- coding:utf-8 -*- # # Import OBJ files # # External dependencies # Import a mesh from a OBJ / SMF file # Initialisation # Read each line in the file # Empty line / Comment # Split values in the line # Vertex # Face (index starts at 1) # Normal # Color # Texture # Texture filename # Remap face indices # Return the ...
2.721408
3
pywingui/wtl_core.py
Answeror/lit
0
6631694
## Copyright (c) 2003 <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, publish, ## d...
## Copyright (c) 2003 <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, publish, ## d...
en
0.793058
## Copyright (c) 2003 <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, publish, ## di...
1.855145
2
src/common/package/config/application.py
ammar-khan/raspberry-pi-opencv-dnn-face-detection
3
6631695
<reponame>ammar-khan/raspberry-pi-opencv-dnn-face-detection ## # Copyright 2018, <NAME> # Licensed under MIT. # Since: v1.0.0 ## # Application configuration # HTTP Port for web streaming HTTP_PORT = 8000 # HTTP page template path HTML_TEMPLATE_PATH = '/home/pi/code/raspberry-pi-opencv-dnn-face-detection/src/common/pa...
## # Copyright 2018, <NAME> # Licensed under MIT. # Since: v1.0.0 ## # Application configuration # HTTP Port for web streaming HTTP_PORT = 8000 # HTTP page template path HTML_TEMPLATE_PATH = '/home/pi/code/raspberry-pi-opencv-dnn-face-detection/src/common/package/http/template/' # Capturing device index (used for we...
en
0.544404
## # Copyright 2018, <NAME> # Licensed under MIT. # Since: v1.0.0 ## # Application configuration # HTTP Port for web streaming # HTTP page template path # Capturing device index (used for web camera) # To user Pi Camera # Capture configuration
1.300025
1
adv/yurius.py
Caledor/dl
0
6631696
<gh_stars>0 from core.advbase import * class Yurius(Adv): def prerun(self): self.dragondrive = self.dragonform.set_dragondrive( ModeManager( group="ddrive", buffs=[ Selfbuff("dragondrive_sd", 0.35, -1, "s", "passive"), Sel...
from core.advbase import * class Yurius(Adv): def prerun(self): self.dragondrive = self.dragonform.set_dragondrive( ModeManager( group="ddrive", buffs=[ Selfbuff("dragondrive_sd", 0.35, -1, "s", "passive"), Selfbuff("drago...
none
1
2.124305
2
utils/utility.py
itsPeetah/image-2-text-converter
0
6631697
def prompt_conversion_type_selection(): choice = int(input("What kind of convertion do you wnat to use? ( 1: ascii-art, 2: braille)\n>>> ")) while choice < 1 or choice > 2: print("Invalid answer, please, try again.") choice = int(input("What kind of convertion do you wnat to use? ( 1: ascii-art,...
def prompt_conversion_type_selection(): choice = int(input("What kind of convertion do you wnat to use? ( 1: ascii-art, 2: braille)\n>>> ")) while choice < 1 or choice > 2: print("Invalid answer, please, try again.") choice = int(input("What kind of convertion do you wnat to use? ( 1: ascii-art,...
en
0.746873
Scale the pixel gray rgb value to fit into the palette and pick the correspondig color Prompt the user to resize the image and calculate new size
3.965509
4
score.py
vkesanam/CustomVision
10
6631698
# Run the following score.py from the notebook to generate the web serivce schema JSON file # Learn more about creating score file from here: https://docs.microsoft.com/en-us/azure/machine-learning/preview/model-management-service-deploy def init(): from sklearn.externals import joblib global model model ...
# Run the following score.py from the notebook to generate the web serivce schema JSON file # Learn more about creating score file from here: https://docs.microsoft.com/en-us/azure/machine-learning/preview/model-management-service-deploy def init(): from sklearn.externals import joblib global model model ...
en
0.655796
# Run the following score.py from the notebook to generate the web serivce schema JSON file # Learn more about creating score file from here: https://docs.microsoft.com/en-us/azure/machine-learning/preview/model-management-service-deploy # Check the output of the function # Generate the service_schema.json
2.932896
3
myvenv/lib/python3.7/site-packages/paste/auth/auth_tkt.py
kevintu2/spark-se-assessment
1
6631699
<gh_stars>1-10 # (c) 2005 <NAME> and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php ########################################################################## # # Copyright (c) 2005 Imaginary Landscape LLC and Contributors. #...
# (c) 2005 <NAME> and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php ########################################################################## # # Copyright (c) 2005 Imaginary Landscape LLC and Contributors. # # Permission i...
en
0.770651
# (c) 2005 <NAME> and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php ########################################################################## # # Copyright (c) 2005 Imaginary Landscape LLC and Contributors. # # Permission i...
1.564106
2
QUIC/examples/doq_server.py
Niranjanpandeshwar/Data_Transfer_With_Distributed_Index
0
6631700
<filename>QUIC/examples/doq_server.py import argparse import asyncio import json import logging from typing import Dict, Optional from dnslib.dns import DNSRecord from aioquic.asyncio import QuicConnectionProtocol, serve from aioquic.quic.configuration import QuicConfiguration from aioquic.quic.connection import Quic...
<filename>QUIC/examples/doq_server.py import argparse import asyncio import json import logging from typing import Dict, Optional from dnslib.dns import DNSRecord from aioquic.asyncio import QuicConnectionProtocol, serve from aioquic.quic.configuration import QuicConfiguration from aioquic.quic.connection import Quic...
en
0.888178
# -00 specifies 'dq', 'doq', and 'doq-h00' (the latter obviously tying to # the version of the draft it matches). This is confusing, so we'll just # support them all, until future drafts define conflicting behaviour. Simple in-memory store for session tickets.
2.333119
2
demo/armor_classify/classification.py
DRL-CASIA/Perception
39
6631701
<gh_stars>10-100 import torch from torchvision import transforms import torch.nn as nn import torch.nn.functional as F from PIL import Image import numpy as np class LeNet(nn.Module): def __init__(self): super(LeNet, self).__init__() self.conv1 = nn.Conv2d(3, 12, 3) self.conv2 ...
import torch from torchvision import transforms import torch.nn as nn import torch.nn.functional as F from PIL import Image import numpy as np class LeNet(nn.Module): def __init__(self): super(LeNet, self).__init__() self.conv1 = nn.Conv2d(3, 12, 3) self.conv2 = nn.Conv2d(12, 2...
zh
0.947154
# forward这个函数定义了前向传播的运算 # 流程:卷积->relu->压缩->全连接层->relu->最后再一次全连接层 # 第一层卷积并做非线性变换 # 结果进行压缩 # 第二层卷积并做非线性变换 # 再压缩 # 把二维特征图变为一维,这样全连接层才能处理
2.907692
3
nabu/neuralnetworks/decoders/max_decoder.py
rzcwade/nabu
3
6631702
<filename>nabu/neuralnetworks/decoders/max_decoder.py '''@file max_decoder.py contains the MaxDecoder''' import os import tensorflow as tf import decoder from nabu.neuralnetworks.components import ops class MaxDecoder(decoder.Decoder): '''max Decoder''' def __init__(self, conf, model): ''' De...
<filename>nabu/neuralnetworks/decoders/max_decoder.py '''@file max_decoder.py contains the MaxDecoder''' import os import tensorflow as tf import decoder from nabu.neuralnetworks.components import ops class MaxDecoder(decoder.Decoder): '''max Decoder''' def __init__(self, conf, model): ''' De...
en
0.760865
@file max_decoder.py contains the MaxDecoder max Decoder Decoder constructor Args: conf: the decoder config model: the model that will be used for decoding #get the alphabet decode a batch of data Args: inputs: the inputs as a dictionary of [batch_size x time x ...]...
2.948722
3
gran/utils/data_helper.py
longland-m/wikigen
0
6631703
# From GRAN repo, with minor changes ############################################################################### # # Some code is adapted from https://github.com/JiaxuanYou/graph-generation # ############################################################################### import os import torch import pickle import...
# From GRAN repo, with minor changes ############################################################################### # # Some code is adapted from https://github.com/JiaxuanYou/graph-generation # ############################################################################### import os import torch import pickle import...
en
0.517412
# From GRAN repo, with minor changes ############################################################################### # # Some code is adapted from https://github.com/JiaxuanYou/graph-generation # ############################################################################### # save a list of graphs # if node_id<id_min ...
2.367504
2
tools/build_r8lib.py
demon-xxi/r8
0
6631704
<filename>tools/build_r8lib.py<gh_stars>0 #!/usr/bin/env python # Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. ''' Build r8lib.jar using src/main/keep.txt a...
<filename>tools/build_r8lib.py<gh_stars>0 #!/usr/bin/env python # Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. ''' Build r8lib.jar using src/main/keep.txt a...
en
0.841674
#!/usr/bin/env python # Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. Build r8lib.jar using src/main/keep.txt and test that d8_api_usage_sample.jar works with...
2.030141
2
ambari-agent/src/test/python/TestPuppetExecutor.py
telefonicaid/fiware-cosmos-ambari
0
6631705
#!/usr/bin/env python2.6 ''' 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 "Licens...
#!/usr/bin/env python2.6 ''' 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 "Licens...
en
0.870642
#!/usr/bin/env python2.6 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"); ...
1.86964
2
emoticonvis/apps/api/tests/__init__.py
nanchenchen/emoticon-analysis
10
6631706
<gh_stars>1-10 def api_time_format(dt): """Convert a datetime to string according to the API settings""" from rest_framework.fields import DateTimeField field = DateTimeField() return field.to_representation(dt) def django_time_format(dtstr): """Convert a datetime to string according to the API se...
def api_time_format(dt): """Convert a datetime to string according to the API settings""" from rest_framework.fields import DateTimeField field = DateTimeField() return field.to_representation(dt) def django_time_format(dtstr): """Convert a datetime to string according to the API settings""" f...
en
0.714579
Convert a datetime to string according to the API settings Convert a datetime to string according to the API settings
3.179621
3
boilerplateapp/api/__init__.py
svenstaro/python-web-boilerplate
20
6631707
"""Re-export API.""" from flask import Blueprint api = Blueprint('api', __name__, url_prefix='') from boilerplateapp.api import auth # noqa E402 from boilerplateapp.api import hello # noqa E402
"""Re-export API.""" from flask import Blueprint api = Blueprint('api', __name__, url_prefix='') from boilerplateapp.api import auth # noqa E402 from boilerplateapp.api import hello # noqa E402
en
0.240144
Re-export API. # noqa E402 # noqa E402
1.517123
2
tests/datastructures/arrays/test_missing_number.py
sikakente/educative-io-python
1
6631708
<reponame>sikakente/educative-io-python<gh_stars>1-10 import unittest import pytest from datastructures.arrays.missing_number import missing_number @pytest.mark.parametrize("nums,expected", [ ([3, 0, 1], 2), ([0, 1], 2), ([9, 6, 4, 2, 3, 5, 7, 0, 1], 8) ]) def test_missing_number(nums, expected): asse...
import unittest import pytest from datastructures.arrays.missing_number import missing_number @pytest.mark.parametrize("nums,expected", [ ([3, 0, 1], 2), ([0, 1], 2), ([9, 6, 4, 2, 3, 5, 7, 0, 1], 8) ]) def test_missing_number(nums, expected): assert expected == missing_number(nums) if __name__ == '...
none
1
3.045425
3
pygears/lib/drvrnd.py
bogdanvuk/pygears
120
6631709
from pygears import gear, module from pygears.sim.extens.randomization import randomize, rand_seq from .verif import drv @gear def drvrnd(*, t, cnt=None, cons=None, params=None): return drv( t=t, seq=randomize(t, module().basename, cnt=cnt, cons=cons, params=params))
from pygears import gear, module from pygears.sim.extens.randomization import randomize, rand_seq from .verif import drv @gear def drvrnd(*, t, cnt=None, cons=None, params=None): return drv( t=t, seq=randomize(t, module().basename, cnt=cnt, cons=cons, params=params))
none
1
2.34135
2
app/tests/intersection_test.py
pedrolp85/homework
0
6631710
<reponame>pedrolp85/homework from typer.testing import CliRunner from util import app runner = CliRunner() def test_intersection_1(): result = runner.invoke( app, ["tests/test_files/intersection.log", "--first", 11, "--last", 11] ) assert result.exit_code == 0 assert "L" not in result.stdout ...
from typer.testing import CliRunner from util import app runner = CliRunner() def test_intersection_1(): result = runner.invoke( app, ["tests/test_files/intersection.log", "--first", 11, "--last", 11] ) assert result.exit_code == 0 assert "L" not in result.stdout print(result.stdout) de...
none
1
2.352961
2
src/open_sim.py
pcrumley/IseultServer
1
6631711
<filename>src/open_sim.py from tristan_sim import TristanSim from myCmaps import myCmaps_names def open_sim(simType ='tristan-mp', outdir = ''): if simType =='tristan-mp': mySim = TristanSim(dirpath=outdir) responseDict = mySim.get_avail_prtls() responseDict['cmaps']= myCmaps_names responseDic...
<filename>src/open_sim.py from tristan_sim import TristanSim from myCmaps import myCmaps_names def open_sim(simType ='tristan-mp', outdir = ''): if simType =='tristan-mp': mySim = TristanSim(dirpath=outdir) responseDict = mySim.get_avail_prtls() responseDict['cmaps']= myCmaps_names responseDic...
none
1
2.281064
2
Mean var std.py
jibinmathew691993/PythonHackerrank
0
6631712
import numpy as np n,m = input().split() arr = np.array([input().split() for _ in range(int(n))], int) np.set_printoptions(legacy='1.13') print(np.mean(arr,axis=1)) print(np.var(arr,axis=0)) print(np.std(arr))
import numpy as np n,m = input().split() arr = np.array([input().split() for _ in range(int(n))], int) np.set_printoptions(legacy='1.13') print(np.mean(arr,axis=1)) print(np.var(arr,axis=0)) print(np.std(arr))
none
1
3.232303
3
samr/tests/geometry/test_package.py
ktchu/RESEARCH-PySAMR
0
6631713
""" Unit tests for 'geometry' package. ------------------------------------------------------------------------------ COPYRIGHT/LICENSE. This file is part of the XYZ package. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution. No part of the XYZ package, inc...
""" Unit tests for 'geometry' package. ------------------------------------------------------------------------------ COPYRIGHT/LICENSE. This file is part of the XYZ package. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution. No part of the XYZ package, inc...
en
0.725933
Unit tests for 'geometry' package. ------------------------------------------------------------------------------ COPYRIGHT/LICENSE. This file is part of the XYZ package. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution. No part of the XYZ package, includi...
2.356976
2
tests/components/test_vultr.py
dauden1184/home-assistant
37
6631714
<filename>tests/components/test_vultr.py """The tests for the Vultr component.""" from copy import deepcopy import json import unittest from unittest.mock import patch import requests_mock from homeassistant import setup import homeassistant.components.vultr as vultr from tests.common import ( get_test_home_assi...
<filename>tests/components/test_vultr.py """The tests for the Vultr component.""" from copy import deepcopy import json import unittest from unittest.mock import patch import requests_mock from homeassistant import setup import homeassistant.components.vultr as vultr from tests.common import ( get_test_home_assi...
en
0.737154
The tests for the Vultr component. Tests the Vultr component. Initialize values for this test case class. # pylint: disable=invalid-name Stop everything that we started. Test successful setup. Test failed setup with missing API Key.
2.719335
3
regfile/examples/chiprgfExample/sources/rgf2_defs.py
vhnatyk/vlsistuff
1
6631715
ADDR_MAP = {} WIDTH_MAP = {} ronly = 0x10000 ADDR_MAP["ronly"] = 0x10000 WIDTH_MAP["ronly"] = 4 ronly2 = 0x10004 ADDR_MAP["ronly2"] = 0x10004 WIDTH_MAP["ronly2"] = 4 wonly = 0x10008 ADDR_MAP["wonly"] = 0x10008 WIDTH_MAP["wonly"] = 4 one = 0x1000c ADDR_MAP["one"] = 0x1000c WIDTH_MAP["one"] = 4 rega = 0x10010 ADDR_MAP["r...
ADDR_MAP = {} WIDTH_MAP = {} ronly = 0x10000 ADDR_MAP["ronly"] = 0x10000 WIDTH_MAP["ronly"] = 4 ronly2 = 0x10004 ADDR_MAP["ronly2"] = 0x10004 WIDTH_MAP["ronly2"] = 4 wonly = 0x10008 ADDR_MAP["wonly"] = 0x10008 WIDTH_MAP["wonly"] = 4 one = 0x1000c ADDR_MAP["one"] = 0x1000c WIDTH_MAP["one"] = 4 rega = 0x10010 ADDR_MAP["r...
none
1
1.575051
2
solutions/python3/675.py
sm2774us/amazon_interview_prep_2021
42
6631716
<reponame>sm2774us/amazon_interview_prep_2021<gh_stars>10-100 class Solution: def cutOffTree(self, forest): def hadlocks(forest, sr, sc, tr, tc): R, C = len(forest), len(forest[0]) processed = set() deque = collections.deque([(0, sr, sc)]) while deque: ...
class Solution: def cutOffTree(self, forest): def hadlocks(forest, sr, sc, tr, tc): R, C = len(forest), len(forest[0]) processed = set() deque = collections.deque([(0, sr, sc)]) while deque: detours, r, c = deque.popleft() if (r...
none
1
2.815334
3
tests/pydevtest/test_fuse.py
wtsi-hgi/irods
0
6631717
<filename>tests/pydevtest/test_fuse.py import sys if sys.version_info >= (2, 7): import unittest else: import unittest2 as unittest from resource_suite import ResourceBase import commands import distutils.spawn import os import subprocess import stat import socket import lib class Test_Fuse(ResourceBase, unit...
<filename>tests/pydevtest/test_fuse.py import sys if sys.version_info >= (2, 7): import unittest else: import unittest2 as unittest from resource_suite import ResourceBase import commands import distutils.spawn import os import subprocess import stat import socket import lib class Test_Fuse(ResourceBase, unit...
en
0.727096
# =-=-=-=-=-=-=- # set up a fuse mount # =-=-=-=-=-=-=- # use system copy to put some data into the mount mount # and verify that it shows up in the ils # tear down the fuse mount # Check that fusermount is configured correctly for irodsFs # =-=-=-=-=-=-=- # set up a fuse mount # =-=-=-=-=-=-=- # put some test data # =...
2.440072
2
Twitter/DataAccess/sample.py
aslisabanci/integrations
5
6631718
import Algorithmia input = {"INPUT": "something interesting"} client = Algorithmia.client('YOUR_API_KEY') algo = client.algo('OUR_ALGORITHM') print(algo.pipe(input))
import Algorithmia input = {"INPUT": "something interesting"} client = Algorithmia.client('YOUR_API_KEY') algo = client.algo('OUR_ALGORITHM') print(algo.pipe(input))
none
1
2.240737
2
mccd/grads.py
tobias-liaudat/deep_mccd
0
6631719
<reponame>tobias-liaudat/deep_mccd # -*- coding: utf-8 -*- r"""GRADIENTS. Defines the gradient classes that will be used in the optimization procedures from the ModOpt package. : Authors: <NAME> <<EMAIL>> <NAME> <https://github.com/MorganSchmitz> <NAME> <https://github.com/jerome-bonnin> """...
# -*- coding: utf-8 -*- r"""GRADIENTS. Defines the gradient classes that will be used in the optimization procedures from the ModOpt package. : Authors: <NAME> <<EMAIL>> <NAME> <https://github.com/MorganSchmitz> <NAME> <https://github.com/jerome-bonnin> """ from __future__ import absolute_i...
en
0.549367
# -*- coding: utf-8 -*- GRADIENTS. Defines the gradient classes that will be used in the optimization procedures from the ModOpt package. : Authors: <NAME> <<EMAIL>> <NAME> <https://github.com/MorganSchmitz> <NAME> <https://github.com/jerome-bonnin> Gradient class for the local coefficient upd...
2.69647
3
iota/multisig/crypto/__init__.py
JakeSCahill/iota.py
2
6631720
# coding=utf-8 from __future__ import absolute_import, division, print_function, \ unicode_literals
# coding=utf-8 from __future__ import absolute_import, division, print_function, \ unicode_literals
en
0.644078
# coding=utf-8
0.976469
1
rl_algorithms/fd/dqn_agent.py
MrSyee/rl_algorithms
1
6631721
<reponame>MrSyee/rl_algorithms<filename>rl_algorithms/fd/dqn_agent.py<gh_stars>1-10 # -*- coding: utf-8 -*- """DQfD agent using demo agent for episodic tasks in OpenAI Gym. - Author: <NAME>, <NAME> - Contact: <EMAIL>, <EMAIL> - Paper: https://arxiv.org/pdf/1704.03732.pdf (DQfD) """ import pickle import time from typi...
# -*- coding: utf-8 -*- """DQfD agent using demo agent for episodic tasks in OpenAI Gym. - Author: <NAME>, <NAME> - Contact: <EMAIL>, <EMAIL> - Paper: https://arxiv.org/pdf/1704.03732.pdf (DQfD) """ import pickle import time from typing import Tuple import numpy as np import torch from torch.nn.utils import clip_gra...
en
0.71721
# -*- coding: utf-8 -*- DQfD agent using demo agent for episodic tasks in OpenAI Gym. - Author: <NAME>, <NAME> - Contact: <EMAIL>, <EMAIL> - Paper: https://arxiv.org/pdf/1704.03732.pdf (DQfD) DQN interacting with environment. Attribute: memory (PrioritizedReplayBuffer): replay memory # pylint: disable=att...
2.054038
2
copm_spider/se/se/spiders/sogou.py
tzattack/public_opinion_analysis
0
6631722
<reponame>tzattack/public_opinion_analysis import scrapy import datetime import urllib import codecs import re from se.items import SogouItem import pytz class SogouSpider(scrapy.Spider): name = "sogou" count = 0 mediaName = "搜狗" def __init__(self, page='20', *args, **kwargs): super(SogouSpid...
import scrapy import datetime import urllib import codecs import re from se.items import SogouItem import pytz class SogouSpider(scrapy.Spider): name = "sogou" count = 0 mediaName = "搜狗" def __init__(self, page='20', *args, **kwargs): super(SogouSpider, self).__init__(*args, **kwargs) ...
en
0.233614
搜狗搜索的规则如下: query: 指定搜索词 # 先过滤CDATA # 匹配CDATA # Script # style # 处理换行 # HTML标签 # HTML注释 # 去掉CDATA # 去掉SCRIPT # 去掉style # 将br转换为换行 # 去掉HTML 标签 # 去掉HTML注释 # 去掉多余的空行 # q3 = ['雄安市民服务中心', '雄安市民中心', '雄安中海物业', '雄安中海'] # q4 = ['指数'] # q4 = ['指数', '股份', 'A股', 'H股', '板块', '开盘', '楼市', '成交', '售楼', '公寓', '住宅', '首付', '置业', '户...
2.791259
3
examples/scaling-out/strategy.py
simongarisch/pinkfish
1
6631723
""" stategy --------- """ # use future imports for python 3.x forward compatibility from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import # other imports import pandas as pd import matplotlib.pyplot as plt import datetime f...
""" stategy --------- """ # use future imports for python 3.x forward compatibility from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import # other imports import pandas as pd import matplotlib.pyplot as plt import datetime f...
en
0.74717
stategy --------- # use future imports for python 3.x forward compatibility # other imports # project imports Algo: 1. The SPY is above its 200-day moving average 2. The SPY closes at a X-day low, buy with full capital. 3. If the SPY closes at a X-day high, sell some. ...
2.492517
2
vespene/plugins/organizations/github.py
Conan-Kudo/vespene
11
6631724
# Copyright 2018, <NAME> LLC # License: Apache License Version 2.0 # ------------------------------------------------------------------------- # github.py - plumbing for supporting GitHub within the Vespene # organizational imports feature # ------------------------------------------------------------------------...
# Copyright 2018, <NAME> LLC # License: Apache License Version 2.0 # ------------------------------------------------------------------------- # github.py - plumbing for supporting GitHub within the Vespene # organizational imports feature # ------------------------------------------------------------------------...
en
0.866404
# Copyright 2018, <NAME> LLC # License: Apache License Version 2.0 # ------------------------------------------------------------------------- # github.py - plumbing for supporting GitHub within the Vespene # organizational imports feature # ------------------------------------------------------------------------...
2.150689
2
pydbticket/kci.py
em0lar/pydbticket
2
6631725
import json from typing import Union import jwt import pytz import requests from pydbticket.order import Leg, Ticket def checkin(ticket: Ticket, leg: Leg, coach: Union[int, str], seat: Union[int, str]): """ Makes a SelfCheckIn-Request :param ticket: A valid ticket for the leg :param leg...
import json from typing import Union import jwt import pytz import requests from pydbticket.order import Leg, Ticket def checkin(ticket: Ticket, leg: Leg, coach: Union[int, str], seat: Union[int, str]): """ Makes a SelfCheckIn-Request :param ticket: A valid ticket for the leg :param leg...
en
0.753648
Makes a SelfCheckIn-Request :param ticket: A valid ticket for the leg :param leg: The leg of the order, wich should be checked in :param coach: The Waggon Number :param seat: The Seat Number :return: The JSON-Body of the response
2.806357
3
generator/__init__.py
universuen/pokemon_GAN
1
6631726
<filename>generator/__init__.py from . import * from .core import Generator
<filename>generator/__init__.py from . import * from .core import Generator
none
1
1.091133
1
openfda/downloadstats/pipeline.py
FDA/openfda
388
6631727
#!/usr/bin/python ''' Pipeline for parsing all the access log files (S3 and CloudFront) for dataset downloads and calculating totals. ''' import glob import gzip import json import os import re from os.path import join, dirname import arrow import luigi import pandas as pd from openfda import common, config, index_...
#!/usr/bin/python ''' Pipeline for parsing all the access log files (S3 and CloudFront) for dataset downloads and calculating totals. ''' import glob import gzip import json import os import re from os.path import join, dirname import arrow import luigi import pandas as pd from openfda import common, config, index_...
en
0.860417
#!/usr/bin/python Pipeline for parsing all the access log files (S3 and CloudFront) for dataset downloads and calculating totals. # Cut off S3 access logs at the point when CF logs became available
1.926046
2
pisat/sensor/apds9301.py
jjj999/pisat
1
6631728
<reponame>jjj999/pisat #! python3 """ pisat.sensor.sensor.apds9301 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sensor class of APDS280 compatible with the pisat system. This module works completely, regardless of whether using the pisat system or not. [info] APDS9301 datasheet https://datasheetspdf.com/datasheet/APDS-9301.html...
#! python3 """ pisat.sensor.sensor.apds9301 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sensor class of APDS280 compatible with the pisat system. This module works completely, regardless of whether using the pisat system or not. [info] APDS9301 datasheet https://datasheetspdf.com/datasheet/APDS-9301.html TODO interrupt set...
en
0.48012
#! python3 pisat.sensor.sensor.apds9301 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sensor class of APDS280 compatible with the pisat system. This module works completely, regardless of whether using the pisat system or not. [info] APDS9301 datasheet https://datasheetspdf.com/datasheet/APDS-9301.html TODO interrupt settings,...
2.552639
3
admin/update_sparkle_xml.py
isabella232/zulip-desktop-legacy
13
6631729
#!/usr/bin/env python # Updates a sparkle appcast xml file with a new release from optparse import OptionParser from xml.dom.minidom import parse from datetime import datetime import os parser = OptionParser(r""" %prog --f xmlfile -s "signature" -v X.X.X -l <bytelength>""") parser.add_option("-f", "--file", d...
#!/usr/bin/env python # Updates a sparkle appcast xml file with a new release from optparse import OptionParser from xml.dom.minidom import parse from datetime import datetime import os parser = OptionParser(r""" %prog --f xmlfile -s "signature" -v X.X.X -l <bytelength>""") parser.add_option("-f", "--file", d...
en
0.346812
#!/usr/bin/env python # Updates a sparkle appcast xml file with a new release %prog --f xmlfile -s "signature" -v X.X.X -l <bytelength>
2.277746
2
otcCard/__init__.py
otclab/EstApp
0
6631730
<reponame>otclab/EstApp<filename>otcCard/__init__.py #!/usr/bin/python # -*- coding: utf-8 -*- from .SerialDevice import * from .OTCCard import * from .OTCProtocol import * from .OTCProtocolError import *
#!/usr/bin/python # -*- coding: utf-8 -*- from .SerialDevice import * from .OTCCard import * from .OTCProtocol import * from .OTCProtocolError import *
en
0.44423
#!/usr/bin/python # -*- coding: utf-8 -*-
1.259944
1
intro/part04-18_mean/src/mean.py
Hannah-Abi/python-pro-21
0
6631731
<reponame>Hannah-Abi/python-pro-21 # Write your solution here def mean(list): sum = 0 for i in range(len(list)): sum += list[i] return sum/len(list) # You can test your function by calling it within the following block if __name__ == "__main__": my_list = [3, 6, -4] result = mean(my_list) ...
# Write your solution here def mean(list): sum = 0 for i in range(len(list)): sum += list[i] return sum/len(list) # You can test your function by calling it within the following block if __name__ == "__main__": my_list = [3, 6, -4] result = mean(my_list) print(result)
en
0.928411
# Write your solution here # You can test your function by calling it within the following block
3.8772
4
src/script/sconsign.py
datalogics/scons-1
0
6631732
#! /usr/bin/env python # # SCons - a Software Constructor # # __COPYRIGHT__ # # 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...
#! /usr/bin/env python # # SCons - a Software Constructor # # __COPYRIGHT__ # # 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...
en
0.692321
#! /usr/bin/env python # # SCons - a Software Constructor # # __COPYRIGHT__ # # 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...
1.91717
2
dp_tornado/engine/template/example/model/calc/__init__.py
donghak-shin/dp-tornado
18
6631733
# -*- coding: utf-8 -*- from dp_tornado.engine.model import Model as dpModel class CalcModel(dpModel): pass
# -*- coding: utf-8 -*- from dp_tornado.engine.model import Model as dpModel class CalcModel(dpModel): pass
en
0.769321
# -*- coding: utf-8 -*-
1.301772
1
baselines/convnets-keras/video/datagenerator.py
leix28/ML-Fabri
0
6631734
<reponame>leix28/ML-Fabri #!/usr/bin/env python # encoding: utf-8 # File Name: dataloader.py import numpy as np from progressbar import ProgressBar, Percentage, Bar, ETA, RotatingMarker from keras.utils import np_utils import cv2 import gc import random def test_generator(datasplit, feature, batch_size=32, val=True, ...
#!/usr/bin/env python # encoding: utf-8 # File Name: dataloader.py import numpy as np from progressbar import ProgressBar, Percentage, Bar, ETA, RotatingMarker from keras.utils import np_utils import cv2 import gc import random def test_generator(datasplit, feature, batch_size=32, val=True, nb_classes=14, sz=227): ...
en
0.292815
#!/usr/bin/env python # encoding: utf-8 # File Name: dataloader.py #random.shuffle(ids) #(360-hf-sz, 480-hf), #(360-hf, 480-hf-sz), #(360-hf, 480+hf), #(360+hf, 480-hf) #(360-hf-2*sz, 480-hf), #(360-hf, 480-hf-2*sz), #(360-hf, 480+hf+sz), #(360+hf+sz, 480-hf) points = [(360-114, 480-114)] #X_train.append(fea) #Y_train....
2.488924
2
python/year2018/tests/test_sol08.py
dhruvmanila/advent-of-code
2
6631735
import utils from year2018.sol08 import Node def test_node(): data = utils.read(day=8, year=2018, test=True) datastream = map(int, data.split()) root = Node.from_datastream(datastream) assert root.checksum == 138 assert root.value == 66
import utils from year2018.sol08 import Node def test_node(): data = utils.read(day=8, year=2018, test=True) datastream = map(int, data.split()) root = Node.from_datastream(datastream) assert root.checksum == 138 assert root.value == 66
none
1
2.479642
2
fourlang/service/parser_wrapper.py
recski/wikt2def
0
6631736
import stanfordnlp import os class ParserWrapper(object): def set_parser(self, language): language_model = {"en": "en_ewt", "it": "it_isdt", "de": "de_gsd", "tr": "tr_imst", "hr": "hr_set"} if not os.path.exists(os.path.join(os.path.expanduser("~"), "stan...
import stanfordnlp import os class ParserWrapper(object): def set_parser(self, language): language_model = {"en": "en_ewt", "it": "it_isdt", "de": "de_gsd", "tr": "tr_imst", "hr": "hr_set"} if not os.path.exists(os.path.join(os.path.expanduser("~"), "stan...
none
1
2.63274
3
LintCode/uncategorized/380. Intersection of Two Linked Lists/.ipynb_checkpoints/solution-checkpoint.py
vincent507cpu/Comprehensive-Algorithm-Solution
4
6631737
<gh_stars>1-10 """ Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param headA: the first list @param headB: the second list @return: a ListNode """ def getIntersectionNode(self, head...
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param headA: the first list @param headB: the second list @return: a ListNode """ def getIntersectionNode(self, headA, headB): ...
en
0.476702
Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next @param headA: the first list @param headB: the second list @return: a ListNode # write your code here
3.814061
4
setup.py
danielgoqueiroz/preview-generator
0
6631738
<reponame>danielgoqueiroz/preview-generator # -*- coding: utf-8 -*- # python setup.py sdist upload -r pypi import os import sys from typing import List from preview_generator import infos py_version = sys.version_info[:2] try: from setuptools import find_packages from setuptools import setup except ImportE...
# -*- coding: utf-8 -*- # python setup.py sdist upload -r pypi import os import sys from typing import List from preview_generator import infos py_version = sys.version_info[:2] try: from setuptools import find_packages from setuptools import setup except ImportError: from ez_setup import use_setuptool...
en
0.725888
# -*- coding: utf-8 -*- # python setup.py sdist upload -r pypi # type: List[str] # NOTE - SG - 2021-04-19 - python 3.5 is dropped starting with 8.0.0 # add black for python 3.6+ # TODO - G.M - 2019-11-05 - restore vtk as normal requirement, vtk is not compatible # with current version of vtk see https://gitlab.kitware....
1.586563
2
usaspending_api/etl/management/commands/load_cleanup.py
truthiswill/usaspending-api
0
6631739
""" Cleans up the model description fields. """ from django.core.management.base import BaseCommand from usaspending_api.etl.helpers import update_model_description_fields import logging class Command(BaseCommand): help = "Cleaning up model description fields takes a long time, so use this to update them if you...
""" Cleans up the model description fields. """ from django.core.management.base import BaseCommand from usaspending_api.etl.helpers import update_model_description_fields import logging class Command(BaseCommand): help = "Cleaning up model description fields takes a long time, so use this to update them if you...
en
0.115002
Cleans up the model description fields. # update_awards() # update_contract_awards() # update_award_categories()
1.992255
2
demos/common/python/html_reader.py
APrigarina/open_model_zoo
1,031
6631740
import urllib.request import re from html.parser import HTMLParser import logging as log class HTMLDataExtractor(HTMLParser): def __init__(self, tags): super(HTMLDataExtractor, self).__init__() self.started_tags = {k: [] for k in tags} self.ended_tags = {k: [] for k in tags} def handle...
import urllib.request import re from html.parser import HTMLParser import logging as log class HTMLDataExtractor(HTMLParser): def __init__(self, tags): super(HTMLDataExtractor, self).__init__() self.started_tags = {k: [] for k in tags} self.ended_tags = {k: [] for k in tags} def handle...
en
0.851803
# read html urls and list of all paragraphs data
2.981181
3
spidermon/contrib/monitors/mixins/spider.py
zanachka/spidermon
405
6631741
<reponame>zanachka/spidermon from spidermon.contrib.stats.analyzer import StatsAnalyzer from spidermon.contrib.stats.counters import DictPercentCounter, PercentCounter from spidermon.exceptions import NotConfigured from .job import JobMonitorMixin from .stats import StatsMonitorMixin DOWNLOADER_RESPONSE_COUNT = "down...
from spidermon.contrib.stats.analyzer import StatsAnalyzer from spidermon.contrib.stats.counters import DictPercentCounter, PercentCounter from spidermon.exceptions import NotConfigured from .job import JobMonitorMixin from .stats import StatsMonitorMixin DOWNLOADER_RESPONSE_COUNT = "downloader/response_count" DOWNLO...
en
0.526799
# all status codes # 1xx. informational # 2xx. successful # 3xx. redirections # 4xx. bad requests # 5xx. internal server errors # >= 6xx. others # errors (4xx + 5xx)
2.384419
2
examples/machining/turning/turning_advanced.py
shanep805/p3l-library
0
6631742
# A - Geometric Definitions # A.1 - Set units units_in() # A.2 - Set our geometric interrogation. # Read more here: https://help.paperlessparts.com/article/42-p3l-language-features lathe = analyze_lathe() # B - Part Variables # B.1 - Set Turning Radius, Turning Length, Radial Buffer, Length Buffer, Part Volume, and St...
# A - Geometric Definitions # A.1 - Set units units_in() # A.2 - Set our geometric interrogation. # Read more here: https://help.paperlessparts.com/article/42-p3l-language-features lathe = analyze_lathe() # B - Part Variables # B.1 - Set Turning Radius, Turning Length, Radial Buffer, Length Buffer, Part Volume, and St...
en
0.790526
# A - Geometric Definitions # A.1 - Set units # A.2 - Set our geometric interrogation. # Read more here: https://help.paperlessparts.com/article/42-p3l-language-features # B - Part Variables # B.1 - Set Turning Radius, Turning Length, Radial Buffer, Length Buffer, Part Volume, and Stock Volume # B.2 - Update variables ...
3.118858
3
captain_comeback/test/queue_assertion_helper.py
almathew/captain-comeback
0
6631743
<gh_stars>0 # coding:utf-8 from six.moves import queue class QueueAssertionHelper(object): ANY_CG = object() def assertHasMessageForCg(self, q, message_class, cg_path, **attrs): msg = q.get_nowait() self.assertIsInstance(msg, message_class) if cg_path is self.ANY_CG: retur...
# coding:utf-8 from six.moves import queue class QueueAssertionHelper(object): ANY_CG = object() def assertHasMessageForCg(self, q, message_class, cg_path, **attrs): msg = q.get_nowait() self.assertIsInstance(msg, message_class) if cg_path is self.ANY_CG: return se...
en
0.786515
# coding:utf-8
2.48229
2
metaci/testresults/tests/test_robot_importer.py
giveclarity/MetaCI
0
6631744
import xml.etree.ElementTree as ET from datetime import datetime, timedelta from pathlib import Path, PurePath from unittest import mock from shutil import copyfile import pytest from cumulusci.utils import elementtree_parse_file, temporary_dir from django.utils import timezone from metaci.build.exceptions import Bui...
import xml.etree.ElementTree as ET from datetime import datetime, timedelta from pathlib import Path, PurePath from unittest import mock from shutil import copyfile import pytest from cumulusci.utils import elementtree_parse_file, temporary_dir from django.utils import timezone from metaci.build.exceptions import Bui...
en
0.889471
verify that the task field of a TestResult has been set for a robot test result The importer uses the timestamp of the output file to figure out which task generated the file. It then uses the options of this task to generate the log files. This test creates a few FlowTask objects where one has a ...
2.084718
2
api/commodities/serializers.py
uktrade/market-access-api
0
6631745
from rest_framework import serializers from api.barriers.models import BarrierCommodity from api.metadata.fields import CountryField, TradingBlocField from .models import Commodity class CommoditySerializer(serializers.ModelSerializer): class Meta: model = Commodity fields = ( "id", ...
from rest_framework import serializers from api.barriers.models import BarrierCommodity from api.metadata.fields import CountryField, TradingBlocField from .models import Commodity class CommoditySerializer(serializers.ModelSerializer): class Meta: model = Commodity fields = ( "id", ...
none
1
2.33171
2
src/ralph/cmdb/models_audits.py
quamilek/ralph
0
6631746
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from datetime import datetime import unicodedata from django.conf import settings from django.db import models from django....
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from datetime import datetime import unicodedata from django.conf import settings from django.db import models from django....
en
0.796154
#!/usr/bin/env python # -*- coding: utf-8 -*- # Polish Ł is not handled properly Base abstract class for keeping track of acceptation of change. May be attribute change, or some custom workflow change. Object, old value and new value is not stored here, giving ability to set it according to custom neeeds. ...
1.853747
2
src/classes.py
UoA-eResearch/leapmotion_gestures
9
6631747
import tkinter as tk import numpy as np class GUI: """simple tkinter gui for gesture recognition""" def __init__(self, master): # root window of gui self.master = master master.title("GUI") # text variable to record current gesture self.gesture = tk.StringVar() s...
import tkinter as tk import numpy as np class GUI: """simple tkinter gui for gesture recognition""" def __init__(self, master): # root window of gui self.master = master master.title("GUI") # text variable to record current gesture self.gesture = tk.StringVar() s...
en
0.75268
simple tkinter gui for gesture recognition # root window of gui # text variable to record current gesture # image to be displayed, representing gesture: begin with image of dead parrot # image to display when input is bad # label for gesture text # label with text coloured according to level of fury # label with text c...
3.670818
4
extensions/donjayamanne.python-0.3.21/pythonFiles/refactor.py
maxemiliang/vscode-ext
0
6631748
# Arguments are: # 1. Working directory. # 2. Rope folder import io import sys import json import traceback import rope from rope.base import libutils from rope.refactor.rename import Rename from rope.refactor.extract import ExtractMethod, ExtractVariable import rope.base.project import rope.base.taskhandle WORKSPAC...
# Arguments are: # 1. Working directory. # 2. Rope folder import io import sys import json import traceback import rope from rope.base import libutils from rope.refactor.rename import Rename from rope.refactor.extract import ExtractMethod, ExtractVariable import rope.base.project import rope.base.taskhandle WORKSPAC...
en
0.827049
# Arguments are: # 1. Working directory. # 2. Rope folder Refactor progress information Change Type Enum Base class for refactorings # getting current job set name # getting active job name # adding done percent # we can ignore this exception, as user has cancelled refactoring To be implemented by each base class Extra...
2.278323
2
aws/s3FileListRead.py
tokiwa/tokiwa.github.io
0
6631749
<reponame>tokiwa/tokiwa.github.io from __future__ import print_function import json import urllib import boto3 print('*Loading lambda: s3FileListRead') s3 = boto3.client('s3') def lambda_handler(event, context): print('==== file list in bucket ====') AWS_S3_BUCKET_NAME = 'yujitokiwa-jp-test' s3_resourc...
from __future__ import print_function import json import urllib import boto3 print('*Loading lambda: s3FileListRead') s3 = boto3.client('s3') def lambda_handler(event, context): print('==== file list in bucket ====') AWS_S3_BUCKET_NAME = 'yujitokiwa-jp-test' s3_resource = boto3.resource('s3') bucke...
en
0.836386
# flie name will be printed # file contents will be printed
2.699444
3
hummingbird/ml/_utils.py
JasonNice/hummingbirdtestjn
2
6631750
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """ Colle...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """ Colle...
en
0.763569
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- Collection...
2.029868
2