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 |
|---|---|---|---|---|---|---|---|---|---|---|
stp_core/common/logging/handlers.py | andkononykhin/plenum | 148 | 5700 | <reponame>andkononykhin/plenum<filename>stp_core/common/logging/handlers.py
import logging
class CallbackHandler(logging.Handler):
def __init__(self, typestr, default_tags, callback, override_tags):
"""
Initialize the handler.
"""
super().__init__()
self.callback = callback... | import logging
class CallbackHandler(logging.Handler):
def __init__(self, typestr, default_tags, callback, override_tags):
"""
Initialize the handler.
"""
super().__init__()
self.callback = callback
self.tags = default_tags
self.update_tags(override_tags or ... | en | 0.685446 | Initialize the handler. Passes the log record back to the CLI for rendering Initialize the handler. Captures a record. | 2.510506 | 3 |
blog/migrations/__init__.py | Amohammadi2/django-SPA-blog | 2 | 5701 | # you just need to add some informations here
| # you just need to add some informations here
| en | 0.889329 | # you just need to add some informations here | 1.133479 | 1 |
amocrm_asterisk_ng/crm/amocrm/kernel/calls/call_records/file_converters/core/__init__.py | iqtek/amocrn_asterisk_ng | 0 | 5702 | from .IFileConverter import IFileConverter
| from .IFileConverter import IFileConverter
| none | 1 | 1.138551 | 1 | |
tests/blueprint/test_decorators.py | cuenca-mx/agave | 3 | 5703 | <reponame>cuenca-mx/agave
from functools import wraps
from agave.blueprints.decorators import copy_attributes
def i_am_test(func):
@wraps(func)
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
wrapper.i_am_test = True
return wrapper
class TestResource:
@i_am_test
def retr... | from functools import wraps
from agave.blueprints.decorators import copy_attributes
def i_am_test(func):
@wraps(func)
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
wrapper.i_am_test = True
return wrapper
class TestResource:
@i_am_test
def retrieve(self) -> str:
... | none | 1 | 2.626597 | 3 | |
tools/python/utils/config_parser.py | hanhan9449/mace | 1 | 5704 | # Copyright 2019 The MACE 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 applicable la... | # Copyright 2019 The MACE 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 applicable la... | en | 0.814547 | # Copyright 2019 The MACE 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 applicable la... | 1.660206 | 2 |
main_cross_testing_iseg.py | sami-ets/DeepNormalize | 1 | 5705 | # -*- coding: utf-8 -*-
# Copyright 2019 <NAME>. All Rights Reserved.
#
# Licensed under the MIT License;
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing... | # -*- coding: utf-8 -*-
# Copyright 2019 <NAME>. All Rights Reserved.
#
# Licensed under the MIT License;
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing... | en | 0.802408 | # -*- coding: utf-8 -*- # Copyright 2019 <NAME>. All Rights Reserved. # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT # # Unless required by applicable law or agreed to in writing... | 1.377819 | 1 |
docs/10.level3_demo_streaming/pc_server/server.py | FaBoPlatform/RobotCarAI | 10 | 5706 | <reponame>FaBoPlatform/RobotCarAI<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ClientからOpenCV画像データを受け取り、ライン検出して制御命令を送る
# Server: Jetson TX2
# Client: Jetson TX2/Raspberry Pi3 Docker
# 1. FFMPEG UDP StreamingをClientで実行する。AWS向け10FPS,Jetson TX2向け1FPS
# 2. Serverを起動する
# 3. Clientを起動する
# コード修正
# lib/camera.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ClientからOpenCV画像データを受け取り、ライン検出して制御命令を送る
# Server: Jetson TX2
# Client: Jetson TX2/Raspberry Pi3 Docker
# 1. FFMPEG UDP StreamingをClientで実行する。AWS向け10FPS,Jetson TX2向け1FPS
# 2. Serverを起動する
# 3. Clientを起動する
# コード修正
# lib/camera.py: vid = cv2.VideoCapture()を環境に合わせて修正する必要がある
# ... | ja | 0.842903 | #!/usr/bin/env python # -*- coding: utf-8 -*- # ClientからOpenCV画像データを受け取り、ライン検出して制御命令を送る # Server: Jetson TX2 # Client: Jetson TX2/Raspberry Pi3 Docker # 1. FFMPEG UDP StreamingをClientで実行する。AWS向け10FPS,Jetson TX2向け1FPS # 2. Serverを起動する # 3. Clientを起動する # コード修正 # lib/camera.py: vid = cv2.VideoCapture()を環境に合わせて修正する必要がある # ... | 2.322143 | 2 |
client.py | zackorndorff/revsync | 94 | 5707 | from collections import defaultdict
import json
import re
import redis
import threading
import time
import traceback
import uuid
import base64
import binascii
TTL = 2
hash_keys = ('cmd', 'user')
cmd_hash_keys = {
'comment': ('addr',),
'extra_comment': ('addr',),
'area_comment': ('addr',),
'rename': ('... | from collections import defaultdict
import json
import re
import redis
import threading
import time
import traceback
import uuid
import base64
import binascii
TTL = 2
hash_keys = ('cmd', 'user')
cmd_hash_keys = {
'comment': ('addr',),
'extra_comment': ('addr',),
'area_comment': ('addr',),
'rename': ('... | en | 0.536667 | # reject our own messages | 2.180177 | 2 |
ontask/condition/urls.py | pinheiroo27/ontask_b | 33 | 5708 | # -*- coding: utf-8 -*-
"""URLs to manipulate columns."""
from django.urls import path
from ontask.condition import views
app_name = 'condition'
urlpatterns = [
#
# FILTERS
#
path(
'<int:pk>/create_filter/',
views.FilterCreateView.as_view(),
name='create_filter'),
path('<... | # -*- coding: utf-8 -*-
"""URLs to manipulate columns."""
from django.urls import path
from ontask.condition import views
app_name = 'condition'
urlpatterns = [
#
# FILTERS
#
path(
'<int:pk>/create_filter/',
views.FilterCreateView.as_view(),
name='create_filter'),
path('<... | en | 0.693008 | # -*- coding: utf-8 -*- URLs to manipulate columns. # # FILTERS # # # CONDITIONS # # Clone the condition | 2.104075 | 2 |
VideoClassification/SegmentLevelClassifier/model.py | googleinterns/via-content-understanding | 1 | 5709 | """Copyright 2020 Google LLC
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | """Copyright 2020 Google LLC
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | en | 0.753697 | Copyright 2020 Google LLC 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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distribu... | 2.477708 | 2 |
ivy/functional/backends/jax/old/math.py | faruq2021/ivy | 0 | 5710 | <reponame>faruq2021/ivy<filename>ivy/functional/backends/jax/old/math.py<gh_stars>0
"""
Collection of Jax math functions, wrapped to fit Ivy syntax and signature.
"""
# global
import jax as _jax
import jax.numpy as _jnp
tan = _jnp.tan
acos = _jnp.arccos
atan = _jnp.arctan
atan2 = _jnp.arctan2
cosh = _jnp.cosh
atanh ... | """
Collection of Jax math functions, wrapped to fit Ivy syntax and signature.
"""
# global
import jax as _jax
import jax.numpy as _jnp
tan = _jnp.tan
acos = _jnp.arccos
atan = _jnp.arctan
atan2 = _jnp.arctan2
cosh = _jnp.cosh
atanh = _jnp.arctanh
log = _jnp.log
exp = _jnp.exp
erf = _jax.scipy.special.erf | en | 0.646541 | Collection of Jax math functions, wrapped to fit Ivy syntax and signature. # global | 1.737915 | 2 |
neaten_db.py | Adoni/ZhihuCrawler | 0 | 5711 | <filename>neaten_db.py<gh_stars>0
from pymongo import MongoClient
from pyltp import Segmentor
def insert_questions_from_answered_question():
in_db = MongoClient().zhihu.user_answered_questions
out_db = MongoClient().zhihu_network.questions
existed_question_id = set(map(lambda q: q['_id'], out_db.find()))
... | <filename>neaten_db.py<gh_stars>0
from pymongo import MongoClient
from pyltp import Segmentor
def insert_questions_from_answered_question():
in_db = MongoClient().zhihu.user_answered_questions
out_db = MongoClient().zhihu_network.questions
existed_question_id = set(map(lambda q: q['_id'], out_db.find()))
... | en | 0.488568 | # insert_questions_from_answered_question() # insert_questions_from_followed_question() # insert_questions_from_asked_question() # insert_questions_from_collected_question() #delete_noise_question() #remove_enger_inline() # insert_user_list() # insert_user_follow_question_list() # insert_user_ask_question_list() # inse... | 2.735009 | 3 |
test/tst_vlen.py | timgates42/netcdf4-python | 574 | 5712 | import sys
import unittest
import os
import tempfile
from netCDF4 import Dataset
import numpy as np
from numpy.testing import assert_array_equal
FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
VL_NAME = 'vlen_type'
VL_BASETYPE = np.int16
DIM1_NAME = 'lon'
DIM2_NAME = 'lat'
nlons = 5; nlats = 5... | import sys
import unittest
import os
import tempfile
from netCDF4 import Dataset
import numpy as np
from numpy.testing import assert_array_equal
FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
VL_NAME = 'vlen_type'
VL_BASETYPE = np.int16
DIM1_NAME = 'lon'
DIM2_NAME = 'lat'
nlons = 5; nlats = 5... | en | 0.714528 | #issue458 # Remove the temporary files testing vlen variables # using assertRaisesRegext as a context manager # only works with python >= 2.7 (issue #497) #with self.assertRaisesRegexp(ValueError, 'strings are only supported'): # f.createVariable('foo', str, ('x',)) # issue 333 # issue 526 # Remove the temporary fil... | 2.188759 | 2 |
sonnet/src/once.py | ScriptBox99/deepmind-sonnet | 10,287 | 5713 | # Copyright 2019 The Sonnet 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 applicable l... | # Copyright 2019 The Sonnet 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 applicable l... | en | 0.849068 | # Copyright 2019 The Sonnet 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 applicable l... | 2.821239 | 3 |
env.py | DGarciaMedina/PiArmDiego | 0 | 5714 | <reponame>DGarciaMedina/PiArmDiego
import piarm
import time
import numpy as np
import cv2
import random
class MyArm2D:
def __init__(self, move_robot = False):
self.move_robot = move_robot
if self.move_robot:
self.robot = piarm.PiArm()
self.open_connection()
se... | import piarm
import time
import numpy as np
import cv2
import random
class MyArm2D:
def __init__(self, move_robot = False):
self.move_robot = move_robot
if self.move_robot:
self.robot = piarm.PiArm()
self.open_connection()
self.DEFAULT = [500, 500, 500, 500, 5... | en | 0.889336 | # height in mm of motor 5's axle # All the angles are with respect to the vertical # To prevent it from hitting the base of the arm # angles of motor 3, 4 and 5 ranging between # min_angle and max_angle # This is to check that all the joints (except for the last one) is above # the ground # First, convert the angles in... | 2.743525 | 3 |
src/python/src/grpc/_adapter/_links_test.py | jonywtf/grpc | 1 | 5715 | <gh_stars>1-10
# Copyright 2015, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condi... | # Copyright 2015, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | en | 0.722904 | # Copyright 2015, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f... | 1.509734 | 2 |
tests/_test_progress_board.py | stjordanis/Hyperactive | 382 | 5716 | <gh_stars>100-1000
import os, glob
import subprocess
from subprocess import DEVNULL, STDOUT
abspath = os.path.abspath(__file__)
dir_ = os.path.dirname(abspath)
files = glob.glob(dir_ + "/_progress_board_tests/_test_progress_board_*.py")
for file_path in files:
file_name = str(file_path.rsplit("/", maxsplit=1)[1... | import os, glob
import subprocess
from subprocess import DEVNULL, STDOUT
abspath = os.path.abspath(__file__)
dir_ = os.path.dirname(abspath)
files = glob.glob(dir_ + "/_progress_board_tests/_test_progress_board_*.py")
for file_path in files:
file_name = str(file_path.rsplit("/", maxsplit=1)[1])
try:
... | none | 1 | 1.965066 | 2 | |
pages/forest_pages.py | jhalljhall/beiwe-backend | 1 | 5717 | import csv
import datetime
from collections import defaultdict
from django.contrib import messages
from django.http.response import FileResponse
from django.shortcuts import redirect, render
from django.utils import timezone
from django.views.decorators.http import require_GET, require_http_methods, require_POST
from... | import csv
import datetime
from collections import defaultdict
from django.contrib import messages
from django.http.response import FileResponse
from django.shortcuts import redirect, render
from django.utils import timezone
from django.views.decorators.http import require_GET, require_http_methods, require_POST
from... | en | 0.878145 | # generate chart of study analysis progress logs # this code simultaneously builds up the chart of most recent forest results for date ranges # by participant and tree, and tracks the metadata # generate the date range for charting # ensure that within each tree, only a single set of param values are used (only the mos... | 2.112897 | 2 |
data_scout/transformations/math_custom.py | janthiemen/data_scout | 0 | 5718 | <filename>data_scout/transformations/math_custom.py
from __future__ import division
from .transformation import Transformation
from pyparsing import (Literal, CaselessLiteral, Word, Combine, Group, Optional,
ZeroOrMore, Forward, nums, alphas, oneOf)
import math
import re
import operator
__autho... | <filename>data_scout/transformations/math_custom.py
from __future__ import division
from .transformation import Transformation
from pyparsing import (Literal, CaselessLiteral, Word, Combine, Group, Optional,
ZeroOrMore, Forward, nums, alphas, oneOf)
import math
import re
import operator
__autho... | en | 0.609084 | http://pyparsing.wikispaces.com/file/view/fourFn.py http://pyparsing.wikispaces.com/message/view/home/15549426 All I've done is rewrap Paul McGuire's fourFn.py as a class, so I can use it more easily in other places. Most of this code comes from the fourFn.py pyparsing example Initialize the transformation with the giv... | 2.536453 | 3 |
project/cloudmesh-storage/cloudmesh/vdir/api/manager.py | cybertraining-dsc/fa19-516-171 | 0 | 5719 | #
# this manager stores directly into the db wit Database update
from cloudmesh.mongo.DataBaseDecorator import DatabaseUpdate
from cloudmesh.mongo.CmDatabase import CmDatabase
from cloudmesh.common.console import Console
from cloudmesh.storage.Provider import Provider
import os
from datetime import datetime
class Vd... | #
# this manager stores directly into the db wit Database update
from cloudmesh.mongo.DataBaseDecorator import DatabaseUpdate
from cloudmesh.mongo.CmDatabase import CmDatabase
from cloudmesh.common.console import Console
from cloudmesh.storage.Provider import Provider
import os
from datetime import datetime
class Vd... | en | 0.692126 | # # this manager stores directly into the db wit Database update | 2.487653 | 2 |
redash/query_runner/influx_db.py | cjpit/redash | 1 | 5720 | import json
import logging
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
from influxdb import InfluxDBClusterClient
enabled = True
except ImportError:
enabled = False
def _transform_result(results):
result_columns = []
result_r... | import json
import logging
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
from influxdb import InfluxDBClusterClient
enabled = True
except ImportError:
enabled = False
def _transform_result(results):
result_columns = []
result_r... | none | 1 | 2.220271 | 2 | |
ics/mergeGatingSets.py | victorfica/utils | 5 | 5721 | <filename>ics/mergeGatingSets.py
#!/usr/bin/env python
"""
Usage examples:
python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function functions --ncpus 4 --out functions_extract.csv
sbatch -n 1 -t 3-0 -c 4 -o functions_slurm.txt --wrap="python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function ... | <filename>ics/mergeGatingSets.py
#!/usr/bin/env python
"""
Usage examples:
python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function functions --ncpus 4 --out functions_extract.csv
sbatch -n 1 -t 3-0 -c 4 -o functions_slurm.txt --wrap="python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function ... | en | 0.274444 | #!/usr/bin/env python Usage examples: python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function functions --ncpus 4 --out functions_extract.csv sbatch -n 1 -t 3-0 -c 4 -o functions_slurm.txt --wrap="python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function functions --ncpus 4 --out functions_ex... | 1.32935 | 1 |
meeting.py | zoni/ulauncher-meet | 4 | 5722 | from dataclasses import dataclass
@dataclass
class Meeting:
name: str
id: str
| from dataclasses import dataclass
@dataclass
class Meeting:
name: str
id: str
| none | 1 | 1.710146 | 2 | |
setup.py | uuosio/uuosio.gscdk | 6 | 5723 | <filename>setup.py<gh_stars>1-10
import os
import shutil
import setuptools
# from skbuild import setup
from distutils.core import setup
from distutils.sysconfig import get_python_lib
import glob
# if os.path.exists('pysrc/tinygo'):
# shutil.rmtree('pysrc/tinygo')
# shutil.copytree('tinygo/build/release/tinygo', ... | <filename>setup.py<gh_stars>1-10
import os
import shutil
import setuptools
# from skbuild import setup
from distutils.core import setup
from distutils.sysconfig import get_python_lib
import glob
# if os.path.exists('pysrc/tinygo'):
# shutil.rmtree('pysrc/tinygo')
# shutil.copytree('tinygo/build/release/tinygo', ... | en | 0.29999 | # from skbuild import setup # if os.path.exists('pysrc/tinygo'): # shutil.rmtree('pysrc/tinygo') # shutil.copytree('tinygo/build/release/tinygo', 'pysrc/tinygo') # print(release_files) # "": ["*"], # scripts=['compiler/build/release/tinygo/bin/eosio-go'], # install_requires=[ # ], # include_package_data=True | 1.747004 | 2 |
tests/data_creator_action.py | michalurbanski/bkgames | 0 | 5724 | from typing import Callable
class DataCreatorAction:
def __init__(self, func: Callable, priority_for_creation: int = 99, priority_for_removal: int = 99):
self.func = func
self.priority_for_creation = priority_for_creation
self.priority_for_removal = priority_for_removal
| from typing import Callable
class DataCreatorAction:
def __init__(self, func: Callable, priority_for_creation: int = 99, priority_for_removal: int = 99):
self.func = func
self.priority_for_creation = priority_for_creation
self.priority_for_removal = priority_for_removal
| none | 1 | 2.669125 | 3 | |
Python/Numpy/Min and Max/min_and_max.py | brianchiang-tw/HackerRank | 2 | 5725 | import numpy as np
if __name__ == '__main__':
h, w = map( int, input().split() )
row_list = []
for i in range(h):
single_row = list( map(int, input().split() ) )
np_row = np.array( single_row )
row_list.append( np_row )
min_of_each_row = np.min( row_list, axis = 1)
... | import numpy as np
if __name__ == '__main__':
h, w = map( int, input().split() )
row_list = []
for i in range(h):
single_row = list( map(int, input().split() ) )
np_row = np.array( single_row )
row_list.append( np_row )
min_of_each_row = np.min( row_list, axis = 1)
... | none | 1 | 3.401868 | 3 | |
allure/pytest_plugin.py | allure-framework/allure-pytest | 112 | 5726 | import uuid
import pickle
import pytest
import argparse
from collections import namedtuple
from six import text_type
from allure.common import AllureImpl, StepContext
from allure.constants import Status, AttachmentType, Severity, \
FAILED_STATUSES, Label, SKIPPED_STATUSES
from allure.utils import parent_module, p... | import uuid
import pickle
import pytest
import argparse
from collections import namedtuple
from six import text_type
from allure.common import AllureImpl, StepContext
from allure.constants import Status, AttachmentType, Severity, \
FAILED_STATUSES, Label, SKIPPED_STATUSES
from allure.utils import parent_module, p... | en | 0.801677 | argparse-type factory for labelish things. processed value is set of tuples (name, value). :param name: of label type (for future TestLabel things) :param legal_values: a `set` of values that are legal for this label, if any limit whatsoever :raises ArgumentTypeError: if `legal_values` a... | 2.176943 | 2 |
treenode/debug.py | domlysi/django-treenode | 0 | 5727 | <reponame>domlysi/django-treenode
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import connection
import logging
import timeit
logger = logging.getLogger(__name__)
class debug_performance(object):
def __init__(self, message_prefix=''):
super(debug_performance, self).__init__... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.db import connection
import logging
import timeit
logger = logging.getLogger(__name__)
class debug_performance(object):
def __init__(self, message_prefix=''):
super(debug_performance, self).__init__()
self.__message_prefix =... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.095897 | 2 |
String_tool.py | vibhorvk/BlendString | 0 | 5728 | bl_info = {
"name": "STRING",
"blender": (2, 80, 0),
"category": "Object",
'Author' : '<NAME>'
}
import bpy
import bmesh
class STRING(bpy.types.Operator):
"""My Object Moving Script""" # Use this as a tooltip for menu items and buttons.
bl_idname = "object.stringtool_ot" ... | bl_info = {
"name": "STRING",
"blender": (2, 80, 0),
"category": "Object",
'Author' : '<NAME>'
}
import bpy
import bmesh
class STRING(bpy.types.Operator):
"""My Object Moving Script""" # Use this as a tooltip for menu items and buttons.
bl_idname = "object.stringtool_ot" ... | en | 0.785763 | My Object Moving Script # Use this as a tooltip for menu items and buttons. # Unique identifier for buttons and menu items to reference. # Display name in the interface. # Enable undo for the operator. # The original script #################### #to create an edge between two given objects #creating the vertices using t... | 2.630302 | 3 |
Code/DataHandlers/__init__.py | aricsanders/pyMez3 | 2 | 5729 | """
The DataHandlers subpackage is designed to manipulate data, by allowing different data types to be opened,
created, saved and updated. The subpackage is further divided into modules grouped by a common theme. Classes for data
that are already on disk normally follows the following pattern:
`instance=ClassName(file_... | """
The DataHandlers subpackage is designed to manipulate data, by allowing different data types to be opened,
created, saved and updated. The subpackage is further divided into modules grouped by a common theme. Classes for data
that are already on disk normally follows the following pattern:
`instance=ClassName(file_... | en | 0.654813 | The DataHandlers subpackage is designed to manipulate data, by allowing different data types to be opened, created, saved and updated. The subpackage is further divided into modules grouped by a common theme. Classes for data that are already on disk normally follows the following pattern: `instance=ClassName(file_path... | 2.85968 | 3 |
djangomail/backends/dummy.py | somenzz/djangomail | 1 | 5730 | <reponame>somenzz/djangomail
"""
Dummy email backend that does nothing.
"""
from djangomail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(list(email_messages))
| """
Dummy email backend that does nothing.
"""
from djangomail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(list(email_messages)) | en | 0.970444 | Dummy email backend that does nothing. | 1.990811 | 2 |
awx/plugins/library/scan_services.py | Avinesh/awx | 17 | 5731 | <filename>awx/plugins/library/scan_services.py
#!/usr/bin/env python
import re
from ansible.module_utils.basic import * # noqa
DOCUMENTATION = '''
---
module: scan_services
short_description: Return service state information as fact data
description:
- Return service state information as fact data for various se... | <filename>awx/plugins/library/scan_services.py
#!/usr/bin/env python
import re
from ansible.module_utils.basic import * # noqa
DOCUMENTATION = '''
---
module: scan_services
short_description: Return service state information as fact data
description:
- Return service state information as fact data for various se... | en | 0.681689 | #!/usr/bin/env python # noqa --- module: scan_services short_description: Return service state information as fact data description: - Return service state information as fact data for various service management utilities version_added: "1.9" options: requirements: [ ] author: <NAME> - monit: scan_services # Examp... | 2.22291 | 2 |
app.py | duckm8795/runscope-circleci | 0 | 5732 | import requests
import sys
import time
import os
def main():
trigger_url = sys.argv[1]
trigger_resp = requests.get(trigger_url)
if trigger_resp.ok:
trigger_json = trigger_resp.json().get("data", {})
test_runs = trigger_json.get("runs", [])
print ("Started {} test runs.".format(l... | import requests
import sys
import time
import os
def main():
trigger_url = sys.argv[1]
trigger_resp = requests.get(trigger_url)
if trigger_resp.ok:
trigger_json = trigger_resp.json().get("data", {})
test_runs = trigger_json.get("runs", [])
print ("Started {} test runs.".format(l... | en | 0.773154 | # generate Personal Access Token at https://www.runscope.com/applications | 2.716895 | 3 |
spyse/client.py | fabaff/spyse-python | 9 | 5733 | <reponame>fabaff/spyse-python
import requests
from typing import List, Optional
from .models import AS, Domain, IP, CVE, Account, Certificate, Email, DNSHistoricalRecord, WHOISHistoricalRecord
from .response import Response
from .search_query import SearchQuery
from limiter import get_limiter, limit
class DomainsSea... | import requests
from typing import List, Optional
from .models import AS, Domain, IP, CVE, Account, Certificate, Email, DNSHistoricalRecord, WHOISHistoricalRecord
from .response import Response
from .search_query import SearchQuery
from limiter import get_limiter, limit
class DomainsSearchResults:
def __init__(s... | en | 0.843025 | Returns details about your account quotas. Returns details about an autonomous system by AS number. Returns the precise number of search results that matched the search query. Returns a list of autonomous systems that matched the search query. Allows getting only the first 10,000 results. Returns a list of auto... | 2.29278 | 2 |
talleres_inov_docente/figures/plot_helpers.py | jfcaballero/Tutorial-sobre-scikit-learn-abreviado | 576 | 5734 | from matplotlib.colors import ListedColormap
cm3 = ListedColormap(['#0000aa', '#ff2020', '#50ff50'])
cm2 = ListedColormap(['#0000aa', '#ff2020'])
| from matplotlib.colors import ListedColormap
cm3 = ListedColormap(['#0000aa', '#ff2020', '#50ff50'])
cm2 = ListedColormap(['#0000aa', '#ff2020'])
| none | 1 | 2.31224 | 2 | |
Applications/FlaskApp/errorpages.py | cemac-ccs/FlaskMWE | 0 | 5735 | <filename>Applications/FlaskApp/errorpages.py
from flask import render_template
# Error Pages ----------------------------------------------------------------
def page_not_found(e):
# note that we set the 404 status explicitly
return render_template('404.html.j2'), 404
def page_not_allowed(e):
# note tha... | <filename>Applications/FlaskApp/errorpages.py
from flask import render_template
# Error Pages ----------------------------------------------------------------
def page_not_found(e):
# note that we set the 404 status explicitly
return render_template('404.html.j2'), 404
def page_not_allowed(e):
# note tha... | en | 0.389775 | # Error Pages ---------------------------------------------------------------- # note that we set the 404 status explicitly # note that we set the 403 status explicitly | 2.625605 | 3 |
cppgym/ToyText/BlackJack.py | anhydrous99/cppgym | 0 | 5736 | from .._BlackJack import BlackJackCPP
import gym
import ctypes
import numpy as np
from gym import spaces
class BlackJack(gym.Env):
def __init__(self, natural=False):
self.env = BlackJackCPP(natural)
self.action_space = spaces.Discrete(2)
self.observation_space = spaces.Tuple((
... | from .._BlackJack import BlackJackCPP
import gym
import ctypes
import numpy as np
from gym import spaces
class BlackJack(gym.Env):
def __init__(self, natural=False):
self.env = BlackJackCPP(natural)
self.action_space = spaces.Discrete(2)
self.observation_space = spaces.Tuple((
... | none | 1 | 2.61918 | 3 | |
sdks/python/apache_beam/runners/direct/consumer_tracking_pipeline_visitor_test.py | ajothomas/beam | 5 | 5737 | <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 us... | en | 0.830647 | # # 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 us... | 1.82669 | 2 |
gluon/main.py | scudette/rekall-agent-server | 21 | 5738 | <filename>gluon/main.py
#!/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by <NAME> <<EMAIL>>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The gluon wsgi application
---------------------------
"""
from __future__ import print_function
if False: ... | <filename>gluon/main.py
#!/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by <NAME> <<EMAIL>>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The gluon wsgi application
---------------------------
"""
from __future__ import print_function
if False: ... | en | 0.444099 | #!/bin/env python # -*- coding: utf-8 -*- | This file is part of the web2py Web Framework | Copyrighted by <NAME> <<EMAIL>> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) The gluon wsgi application --------------------------- # DO NOT REMOVE PART OF FREEZE PROCESS #from thread import allocate_lock # Remark... | 2.05725 | 2 |
agents/EWPublisherAgent.py | marc4gov/tokenspice2 | 1 | 5739 | <filename>agents/EWPublisherAgent.py
import logging
log = logging.getLogger('marketagents')
from enforce_typing import enforce_types # type: ignore[import]
import random
from agents.PublisherAgent import PublisherAgent
from agents.PoolAgent import PoolAgent
from util import constants
from util.constants import POOL_W... | <filename>agents/EWPublisherAgent.py
import logging
log = logging.getLogger('marketagents')
from enforce_typing import enforce_types # type: ignore[import]
import random
from agents.PublisherAgent import PublisherAgent
from agents.PoolAgent import PoolAgent
from util import constants
from util.constants import POOL_W... | en | 0.667964 | # type: ignore[import] #magic number #magic number #magic number #name #new DT #magic number #new pool #bind tokens & add initial liquidity #magic number: use all the OCEAN #magic number #create agent Choose what pool to unstake and by how much. Then do the action. #magic number Create datatoken contract and mint DTs t... | 1.791022 | 2 |
lcls_orbit/__init__.py | slaclab/lcls-orbit | 0 | 5740 | import numpy as np
from . import _version
__version__ = _version.get_versions()['version']
HXR_COLORS = ("#000000", "#02004a", "#030069", "#04008f", "#0500b3", "#0700ff")
SXR_COLORS = ("#000000", "#330000", "#520000", "#850000", "#ad0000", "#ff0000")
HXR_AREAS = {
"GUN" : [2017.911, 2018.712],
"L0" : [2018.... | import numpy as np
from . import _version
__version__ = _version.get_versions()['version']
HXR_COLORS = ("#000000", "#02004a", "#030069", "#04008f", "#0500b3", "#0700ff")
SXR_COLORS = ("#000000", "#330000", "#520000", "#850000", "#ad0000", "#ff0000")
HXR_AREAS = {
"GUN" : [2017.911, 2018.712],
"L0" : [2018.... | none | 1 | 2.113801 | 2 | |
tests/test_optimizers_v2/test_optimizers_v2.py | OverLordGoldDragon/dummy | 0 | 5741 | import os
import tempfile
import numpy as np
import tensorflow as tf
from time import time
from termcolor import cprint
from unittest import TestCase
from .. import K
from .. import Input, Dense, GRU, Bidirectional, Embedding
from .. import Model, load_model
from .. import l2
from .. import maxnorm
from .. import Ada... | import os
import tempfile
import numpy as np
import tensorflow as tf
from time import time
from termcolor import cprint
from unittest import TestCase
from .. import K
from .. import Input, Dense, GRU, Bidirectional, Embedding
from .. import Model, load_model
from .. import l2
from .. import maxnorm
from .. import Ada... | en | 0.847521 | # Save/Load, Warm Restarts (w/ cosine annealing) # due to warm restarts # else K.eval before train may fail # for stop-introspection # for stop-introspection # cleanup # tests of non-main features to improve coverage # cleanup # tests losses against original optimizers' # for introspection # for introspection # cleanup | 2.168507 | 2 |
koku/reporting/migrations/0099_ocp_performance.py | Vasyka/koku | 2 | 5742 | # Generated by Django 2.2.10 on 2020-02-18 12:51
import django.contrib.postgres.indexes
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [("reporting", "0098_auto_20200221_2034")]
operations = [
migrations.RunSQL(
"""
dro... | # Generated by Django 2.2.10 on 2020-02-18 12:51
import django.contrib.postgres.indexes
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [("reporting", "0098_auto_20200221_2034")]
operations = [
migrations.RunSQL(
"""
dro... | en | 0.244632 | # Generated by Django 2.2.10 on 2020-02-18 12:51 drop materialized view if exists reporting_ocpallcostlineitem_daily_summary; drop materialized view if exists reporting_ocpallcostlineitem_project_daily_summary; # This extension will help specifically with "col LIKE %val%" # operations. (As long as val is at least 3 cha... | 1.837942 | 2 |
sympy/tensor/tests/test_functions.py | iamabhishek0/sympy | 8,323 | 5743 | <reponame>iamabhishek0/sympy<filename>sympy/tensor/tests/test_functions.py
from sympy.tensor.functions import TensorProduct
from sympy import MatrixSymbol, Matrix, Array
from sympy.abc import x, y, z
from sympy.abc import i, j, k, l
A = MatrixSymbol("A", 3, 3)
B = MatrixSymbol("B", 3, 3)
C = MatrixSymbol("C", 3, 3)
... | from sympy.tensor.functions import TensorProduct
from sympy import MatrixSymbol, Matrix, Array
from sympy.abc import x, y, z
from sympy.abc import i, j, k, l
A = MatrixSymbol("A", 3, 3)
B = MatrixSymbol("B", 3, 3)
C = MatrixSymbol("C", 3, 3)
def test_TensorProduct_construction():
assert TensorProduct(3, 4) == 1... | none | 1 | 2.836197 | 3 | |
app/views.py | Kgermando/sem | 0 | 5744 | <reponame>Kgermando/sem
from django.shortcuts import render
# Create your views here.
class MultipleProxyMiddleware:
FORWARDED_FOR_FIELDS = [
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED_HOST',
'HTTP_X_FORWARDED_SERVER',
]
def __init__(self, get_response):
self.get_response = ... | from django.shortcuts import render
# Create your views here.
class MultipleProxyMiddleware:
FORWARDED_FOR_FIELDS = [
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED_HOST',
'HTTP_X_FORWARDED_SERVER',
]
def __init__(self, get_response):
self.get_response = get_response
def __... | en | 0.905637 | # Create your views here. Rewrites the proxy headers so that only the most recent proxy is used. | 2.2076 | 2 |
webcrawler/crawler/spiders/baselensspider.py | HansZimmer5000/LensComparison | 0 | 5745 | <gh_stars>0
# This module is about my webcrawler with the use of scrapy.
# Its a generell web crawler, but the import and use of GhAdapter makes it usefull for geizhals.de sites.
from abc import ABC, abstractmethod
import scrapy
class BaseLensSpider(scrapy.Spider, ABC):
@property
@abstractmethod
def adapter(self)... | # This module is about my webcrawler with the use of scrapy.
# Its a generell web crawler, but the import and use of GhAdapter makes it usefull for geizhals.de sites.
from abc import ABC, abstractmethod
import scrapy
class BaseLensSpider(scrapy.Spider, ABC):
@property
@abstractmethod
def adapter(self):
raise No... | en | 0.828354 | # This module is about my webcrawler with the use of scrapy. # Its a generell web crawler, but the import and use of GhAdapter makes it usefull for geizhals.de sites. #TODO: make the start_url thing abstract and initialliy with a call to adapter.START_URLS | 2.779231 | 3 |
byol_train.py | fjbriones/deep-text-recognition-benchmark | 0 | 5746 | import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter, ... | import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter, ... | en | 0.619013 | dataset preparation # see https://github.com/clovaai/deep-text-recognition-benchmark/blob/6593928855fb7abb999a99f428b3e4477d4ae356/dataset.py#L130 # 'True' to check training progress with validation function. # weight initialization # for batchnorm. # data parallel for multi-GPU # filter that only require gradient dece... | 2.277019 | 2 |
app/__init__.py | dulin/tornado-test | 0 | 5747 | <filename>app/__init__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python -*-
import aiopg
import psycopg2
import tornado.locks
from tornado.options import define, options
from tornado.web import Application
from app.application import Application
define('port', default=8080, help="listening port")
... | <filename>app/__init__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python -*-
import aiopg
import psycopg2
import tornado.locks
from tornado.options import define, options
from tornado.web import Application
from app.application import Application
define('port', default=8080, help="listening port")
... | en | 0.517603 | #!/usr/bin/env python # -*- coding: utf-8 -*- # -*- mode: python -*- | 2.472201 | 2 |
pipescaler/core/stage.py | KarlTDebiec/PipeScaler | 1 | 5748 | <filename>pipescaler/core/stage.py
#!/usr/bin/env python
# pipescaler/core/stage.py
#
# Copyright (C) 2020-2021 <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license.
from __future__ import annotations
from abc import ABC, abstractmethod
from imp... | <filename>pipescaler/core/stage.py
#!/usr/bin/env python
# pipescaler/core/stage.py
#
# Copyright (C) 2020-2021 <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license.
from __future__ import annotations
from abc import ABC, abstractmethod
from imp... | en | 0.651013 | #!/usr/bin/env python # pipescaler/core/stage.py # # Copyright (C) 2020-2021 <NAME> # All rights reserved. # # This software may be modified and distributed under the terms of the # BSD license. # Get stage's class name # get first key # Get stage's configuration # Get stage's class Base class for stages. Val... | 2.107231 | 2 |
leetcode/970_powerful_integers/970_powerful_integers.py | ryangillard/misc | 0 | 5749 | <gh_stars>0
class Solution(object):
def powerfulIntegers(self, x, y, bound):
"""
:type x: int
:type y: int
:type bound: int
:rtype: List[int]
"""
# Find max exponent
base = max(x, y) if x == 1 or y == 1 else min(x, y)
exponent = 1
if ba... | class Solution(object):
def powerfulIntegers(self, x, y, bound):
"""
:type x: int
:type y: int
:type bound: int
:rtype: List[int]
"""
# Find max exponent
base = max(x, y) if x == 1 or y == 1 else min(x, y)
exponent = 1
if base != 1:
... | en | 0.438869 | :type x: int :type y: int :type bound: int :rtype: List[int] # Find max exponent # Brute force all of the exponent trials | 3.205057 | 3 |
src/project/api/rankings/urls.py | jSkrod/djangae-react-browser-games-app | 0 | 5750 | <filename>src/project/api/rankings/urls.py
from django.conf.urls import url, include
from project.api.rankings.api import AddRanking, AddScore, GetScoresUser, GetScoresGame
urlpatterns = [
url(r'add_ranking$', AddRanking.as_view()),
url(r'add_score$', AddScore.as_view()),
url(r'get_scores_game$', GetScores... | <filename>src/project/api/rankings/urls.py
from django.conf.urls import url, include
from project.api.rankings.api import AddRanking, AddScore, GetScoresUser, GetScoresGame
urlpatterns = [
url(r'add_ranking$', AddRanking.as_view()),
url(r'add_score$', AddScore.as_view()),
url(r'get_scores_game$', GetScores... | none | 1 | 1.701825 | 2 | |
qiskit_metal/qlibrary/lumped/cap_n_interdigital.py | wdczdj/qiskit-metal | 0 | 5751 | <filename>qiskit_metal/qlibrary/lumped/cap_n_interdigital.py
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source t... | <filename>qiskit_metal/qlibrary/lumped/cap_n_interdigital.py
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source t... | en | 0.773817 | # -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any ... | 2.286549 | 2 |
ThirdParty/protobuf-registry/python/protobufs/services/feature/actions/get_flags_pb2.py | getcircle/luno-ios | 0 | 5752 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protobufs/services/feature/actions/get_flags.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database... | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protobufs/services/feature/actions/get_flags.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database... | en | 0.504984 | # Generated by the protocol buffer compiler. DO NOT EDIT! # source: protobufs/services/feature/actions/get_flags.proto # @@protoc_insertion_point(imports) # @@protoc_insertion_point(class_scope:services.feature.actions.get_flags.RequestV1) # @@protoc_insertion_point(class_scope:services.feature.actions.get_flags.Respo... | 1.0697 | 1 |
Medium/102_2.py | Hellofafar/Leetcode | 6 | 5753 | <reponame>Hellofafar/Leetcode
# ------------------------------
# Binary Tree Level Order Traversal
#
# Description:
# Given a binary tree, return the level order traversal of its nodes' values. (ie, from
# left to right, level by level).
#
# For example:
# Given binary tree [3,9,20,null,null,15,7],
# 3
# / \
... | # ------------------------------
# Binary Tree Level Order Traversal
#
# Description:
# Given a binary tree, return the level order traversal of its nodes' values. (ie, from
# left to right, level by level).
#
# For example:
# Given binary tree [3,9,20,null,null,15,7],
# 3
# / \
# 9 20
# / \
# 15 ... | en | 0.691893 | # ------------------------------ # Binary Tree Level Order Traversal # # Description: # Given a binary tree, return the level order traversal of its nodes' values. (ie, from # left to right, level by level). # # For example: # Given binary tree [3,9,20,null,null,15,7], # 3 # / \ # 9 20 # / \ # 15 7 ... | 4.180687 | 4 |
mturk/comparison_among_different_models/sample_from_models_for_comparison.py | qiaone/GIF | 322 | 5754 | import sys
sys.path.append('../../')
import constants as cnst
import os
os.environ['PYTHONHASHSEED'] = '2'
import tqdm
from model.stg2_generator import StyledGenerator
import numpy as np
from my_utils.visualize_flame_overlay import OverLayViz
from my_utils.flm_dynamic_fit_overlay import camera_ringnetpp
from my_utils.g... | import sys
sys.path.append('../../')
import constants as cnst
import os
os.environ['PYTHONHASHSEED'] = '2'
import tqdm
from model.stg2_generator import StyledGenerator
import numpy as np
from my_utils.visualize_flame_overlay import OverLayViz
from my_utils.flm_dynamic_fit_overlay import camera_ringnetpp
from my_utils.g... | en | 0.434411 | # General settings # with sqrt(2) # run_ids_1 = [7, 24, 8, 3] # run_ids_1 = [7, 8, 3] # overlay_visualizer.setup_renderer(mesh_file=None) # tz = camera_params['f'][0] / (camera_params['c'][0] * flame_param[:, 156:157]) # flame_param[:, 156:159] = np.concatenate((flame_param[:, 157:], tz), axis=1) # import ipdb; ipdb.se... | 1.701702 | 2 |
setup.py | philippWassibauer/django-activity-stream | 4 | 5755 | <reponame>philippWassibauer/django-activity-stream
from distutils.core import setup
""" django-activity-stream instalation script """
setup(
name = 'activity_stream',
description = 'generic activity feed system for users',
author = '<NAME>',
author_email = '<EMAIL>',
url='http://github.com/philipp... | from distutils.core import setup
""" django-activity-stream instalation script """
setup(
name = 'activity_stream',
description = 'generic activity feed system for users',
author = '<NAME>',
author_email = '<EMAIL>',
url='http://github.com/philippWassibauer/django-activity-stream',
download_url... | en | 0.551158 | django-activity-stream instalation script | 1.216314 | 1 |
02/selenium.02.py | study-machine-learning/dongheon.shin | 2 | 5756 | <gh_stars>1-10
from selenium import webdriver
username = "henlix"
password = "<PASSWORD>"
browser = webdriver.PhantomJS()
browser.implicitly_wait(5)
url_login = "https://nid.naver.com/nidlogin.login"
browser.get(url_login)
el = browser.find_element_by_id("id")
el.clear()
el.send_keys(username)
el = browser.find_el... | from selenium import webdriver
username = "henlix"
password = "<PASSWORD>"
browser = webdriver.PhantomJS()
browser.implicitly_wait(5)
url_login = "https://nid.naver.com/nidlogin.login"
browser.get(url_login)
el = browser.find_element_by_id("id")
el.clear()
el.send_keys(username)
el = browser.find_element_by_id("pw... | en | 0.134018 | # PYTHONIOENCODING=utf-8:surrogateescape python3 selenium.02.py | 3.260567 | 3 |
visualization/matplotlib/barwitherror.py | Licas/datascienceexamples | 0 | 5757 | <filename>visualization/matplotlib/barwitherror.py<gh_stars>0
from matplotlib import pyplot as plt
drinks = ["cappuccino", "latte", "chai", "americano", "mocha", "espresso"]
ounces_of_milk = [6, 9, 4, 0, 9, 0]
error = [0.6, 0.9, 0.4, 0, 0.9, 0]
#Yerr -> element at i position represents +/- error[i] variance on bar[i]... | <filename>visualization/matplotlib/barwitherror.py<gh_stars>0
from matplotlib import pyplot as plt
drinks = ["cappuccino", "latte", "chai", "americano", "mocha", "espresso"]
ounces_of_milk = [6, 9, 4, 0, 9, 0]
error = [0.6, 0.9, 0.4, 0, 0.9, 0]
#Yerr -> element at i position represents +/- error[i] variance on bar[i]... | en | 0.649798 | #Yerr -> element at i position represents +/- error[i] variance on bar[i] value | 3.397583 | 3 |
Packs/mnemonicMDR/Integrations/ArgusManagedDefence/ArgusManagedDefence.py | matan-xmcyber/content | 0 | 5758 | import demistomock as demisto
from CommonServerPython import *
""" IMPORTS """
import json
import urllib3
import dateparser
import traceback
from typing import Any, Dict, List, Union
import logging
from argus_api import session as argus_session
from argus_api.api.currentuser.v1.user import get_current_user
from ... | import demistomock as demisto
from CommonServerPython import *
""" IMPORTS """
import json
import urllib3
import dateparser
import traceback
from typing import Any, Dict, List, Union
import logging
from argus_api import session as argus_session
from argus_api.api.currentuser.v1.user import get_current_user
from ... | en | 0.407693 | IMPORTS # Disable insecure warnings CONSTANTS HELPER FUNCTIONS #{data['id']}: {data['subject']}\n" ### *{comment['addedByUser']['userName']} - {pretty_print_date(comment['addedTime'])}*\n" COMMAND FUNCTIONS # noinspection PyTypeChecker #{case_id}: Added comment\n" # noinspection PyTypeChecker #{case_id}: close case\n" ... | 1.845523 | 2 |
03.py | SnowWolf75/aoc-2020 | 0 | 5759 | #!/usr/bin/env python3
import sys, os
import unittest
from lib.common import *
filename = "inputs/2020_12_03_input.txt"
class day03:
def __init__(self):
pass
class day03part1(day03):
def solve(self, args):
pass
class day03part2(day03):
def solve(self, args):
pass
class exampl... | #!/usr/bin/env python3
import sys, os
import unittest
from lib.common import *
filename = "inputs/2020_12_03_input.txt"
class day03:
def __init__(self):
pass
class day03part1(day03):
def solve(self, args):
pass
class day03part2(day03):
def solve(self, args):
pass
class exampl... | en | 0.093705 | #!/usr/bin/env python3 # self.assetTrue() # self.assetTrue() | 3.083458 | 3 |
scripts/examples/tools/capturebat.py | fortinet/ips-bph-framework | 21 | 5760 | <gh_stars>10-100
# Tool Imports
from bph.tools.windows.capturebat import BphCaptureBat as CaptureBat
# Core Imports
from bph.core.server.template import BphTemplateServer as TemplateServer
from bph.core.sample import BphSample as Sample
from bph.core.sample import BphLabFile as LabFile
from bph.core.session imp... | # Tool Imports
from bph.tools.windows.capturebat import BphCaptureBat as CaptureBat
# Core Imports
from bph.core.server.template import BphTemplateServer as TemplateServer
from bph.core.sample import BphSample as Sample
from bph.core.sample import BphLabFile as LabFile
from bph.core.session import BphSession as... | en | 0.483735 | # Tool Imports # Core Imports | 1.681404 | 2 |
dymos/utils/test/test_hermite.py | kaushikponnapalli/dymos | 104 | 5761 | import unittest
import numpy as np
from numpy.testing import assert_almost_equal
from dymos.utils.hermite import hermite_matrices
class TestHermiteMatrices(unittest.TestCase):
def test_quadratic(self):
# Interpolate with values and rates provided at [-1, 1] in tau space
tau_given = [-1.0, 1.0]... | import unittest
import numpy as np
from numpy.testing import assert_almost_equal
from dymos.utils.hermite import hermite_matrices
class TestHermiteMatrices(unittest.TestCase):
def test_quadratic(self):
# Interpolate with values and rates provided at [-1, 1] in tau space
tau_given = [-1.0, 1.0]... | en | 0.797721 | # Interpolate with values and rates provided at [-1, 1] in tau space # In time space use the boundaries [-2, 2] # Provide values for y = t**2 and its time-derivative # Get the hermite matrices. # Interpolate y and ydot at tau_eval points in tau space. # Compute our function as a point of comparison. # Check results # I... | 2.854265 | 3 |
xl_auth/settings.py | libris/xl_auth | 7 | 5762 | # -*- coding: utf-8 -*-
"""Application configuration."""
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from . import __author__, __name__, __version__
class Config(object):
"""Base configuration."""
SERVER_NAME = os.environ.get('SERVER_NAME', None)
PREFER... | # -*- coding: utf-8 -*-
"""Application configuration."""
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from . import __author__, __name__, __version__
class Config(object):
"""Base configuration."""
SERVER_NAME = os.environ.get('SERVER_NAME', None)
PREFER... | en | 0.652025 | # -*- coding: utf-8 -*- Application configuration. Base configuration. # TODO: Change me # This directory. # Disable Debug toolbar. # Can be "memcached", "redis", etc. Production configuration. # Disable Debug toolbar. Development configuration. # Put the db file in project root # Can be "memcached", "redis", etc. Test... | 1.716154 | 2 |
tests/mrp/test_mrp_auth.py | evanreichard/pyatv | 0 | 5763 | <gh_stars>0
"""Functional authentication tests with fake MRP Apple TV."""
import inspect
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop
import pyatv
from pyatv import exceptions
from pyatv.const import Protocol
from pyatv.conf import MrpService, AppleTV
from pyatv.mrp.server_auth import PIN_CODE, ... | """Functional authentication tests with fake MRP Apple TV."""
import inspect
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop
import pyatv
from pyatv import exceptions
from pyatv.const import Protocol
from pyatv.conf import MrpService, AppleTV
from pyatv.mrp.server_auth import PIN_CODE, CLIENT_IDENT... | en | 0.752164 | Functional authentication tests with fake MRP Apple TV. | 2.477239 | 2 |
tests_app/tests/functional/key_constructor/bits/models.py | maryokhin/drf-extensions | 1 | 5764 | # -*- coding: utf-8 -*-
from django.db import models
class KeyConstructorUserProperty(models.Model):
name = models.CharField(max_length=100)
class Meta:
app_label = 'tests_app'
class KeyConstructorUserModel(models.Model):
property = models.ForeignKey(KeyConstructorUserProperty)
class Meta:... | # -*- coding: utf-8 -*-
from django.db import models
class KeyConstructorUserProperty(models.Model):
name = models.CharField(max_length=100)
class Meta:
app_label = 'tests_app'
class KeyConstructorUserModel(models.Model):
property = models.ForeignKey(KeyConstructorUserProperty)
class Meta:... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.998697 | 2 |
ngraph_onnx/onnx_importer/utils/numeric_limits.py | cliveseldon/ngraph-onnx | 0 | 5765 | # ******************************************************************************
# Copyright 2018 Intel Corporation
#
# 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.o... | # ******************************************************************************
# Copyright 2018 Intel Corporation
#
# 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.o... | en | 0.647903 | # ****************************************************************************** # Copyright 2018 Intel Corporation # # 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.o... | 2.468176 | 2 |
curvpack/utils.py | AbhilashReddyM/curvpack | 8 | 5766 | <filename>curvpack/utils.py
import numpy as np
# The first two functions are modified from MNE surface project. LIcense follows
# This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.
#
# Copyright (c) 2011-2019, authors of MNE-Python. All rights... | <filename>curvpack/utils.py
import numpy as np
# The first two functions are modified from MNE surface project. LIcense follows
# This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.
#
# Copyright (c) 2011-2019, authors of MNE-Python. All rights... | en | 0.80411 | # The first two functions are modified from MNE surface project. LIcense follows # This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative. # # Copyright (c) 2011-2019, authors of MNE-Python. All rights reserved. # # Redistribution and use in source a... | 1.841129 | 2 |
tests/unit/core/streams/test_stream_zero.py | tethys-platform/tethys | 2 | 5767 | # Copyright 2020 Konstruktor, 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 la... | # Copyright 2020 Konstruktor, 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 la... | en | 0.816289 | # Copyright 2020 Konstruktor, 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 la... | 1.797215 | 2 |
amd64-linux/lib/ppc64_simple_components.py | qiyancos/Simics-3.0.31 | 1 | 5768 | ## Copyright 2005-2007 Virtutech AB
##
## The contents herein are Source Code which are a subset of Licensed
## Software pursuant to the terms of the Virtutech Simics Software
## License Agreement (the "Agreement"), and are being distributed under
## the Agreement. You should have received a copy of the Agreeme... | ## Copyright 2005-2007 Virtutech AB
##
## The contents herein are Source Code which are a subset of Licensed
## Software pursuant to the terms of the Virtutech Simics Software
## License Agreement (the "Agreement"), and are being distributed under
## the Agreement. You should have received a copy of the Agreeme... | en | 0.870533 | ## Copyright 2005-2007 Virtutech AB ## ## The contents herein are Source Code which are a subset of Licensed ## Software pursuant to the terms of the Virtutech Simics Software ## License Agreement (the "Agreement"), and are being distributed under ## the Agreement. You should have received a copy of the Agreement... | 2.174327 | 2 |
Front-end (Django)/course/migrations/0002_subject_number_of_questions.py | shadow0403bsr/AutomatedGradingSoftware | 0 | 5769 | # Generated by Django 3.0.1 on 2020-02-15 06:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='subject',
name='Number_Of_Questions',
... | # Generated by Django 3.0.1 on 2020-02-15 06:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='subject',
name='Number_Of_Questions',
... | en | 0.837927 | # Generated by Django 3.0.1 on 2020-02-15 06:02 | 1.733961 | 2 |
cornflow/tests/unit/test_dags.py | pchtsp/corn | 5 | 5770 | """
Unit test for the DAG endpoints
"""
# Import from libraries
import json
# Import from internal modules
from cornflow.shared.const import EXEC_STATE_CORRECT, EXEC_STATE_MANUAL
from cornflow.tests.const import (
DAG_URL,
EXECUTION_URL_NORUN,
CASE_PATH,
INSTANCE_URL,
)
from cornflow.tests.unit.test_e... | """
Unit test for the DAG endpoints
"""
# Import from libraries
import json
# Import from internal modules
from cornflow.shared.const import EXEC_STATE_CORRECT, EXEC_STATE_MANUAL
from cornflow.tests.const import (
DAG_URL,
EXECUTION_URL_NORUN,
CASE_PATH,
INSTANCE_URL,
)
from cornflow.tests.unit.test_e... | en | 0.710075 | Unit test for the DAG endpoints # Import from libraries # Import from internal modules | 2.45632 | 2 |
nets/resnet.py | xwshi/faster-rcnn-keras | 0 | 5771 | #-------------------------------------------------------------#
# ResNet50的网络部分
#-------------------------------------------------------------#
import keras.backend as K
from keras import backend as K
from keras import initializers, layers, regularizers
from keras.engine import InputSpec, Layer
from keras.init... | #-------------------------------------------------------------#
# ResNet50的网络部分
#-------------------------------------------------------------#
import keras.backend as K
from keras import backend as K
from keras import initializers, layers, regularizers
from keras.engine import InputSpec, Layer
from keras.init... | en | 0.146847 | #-------------------------------------------------------------# # ResNet50的网络部分 #-------------------------------------------------------------# #-----------------------------------# # 假设输入进来的图片是600,600,3 #-----------------------------------# # 600,600,3 -> 300,300,64 # 300,300,64 -> 150,150,64 # 150,150,64 -> 150,1... | 2.721276 | 3 |
app/api/deps.py | congdh/fastapi-realworld | 0 | 5772 | <gh_stars>0
from typing import Generator
from fastapi import Depends, HTTPException
from fastapi.security import APIKeyHeader
from sqlalchemy.orm import Session
from starlette import status
from app import crud, models
from app.core import security
from app.db.session import SessionLocal
JWT_TOKEN_PREFIX = "Token" ... | from typing import Generator
from fastapi import Depends, HTTPException
from fastapi.security import APIKeyHeader
from sqlalchemy.orm import Session
from starlette import status
from app import crud, models
from app.core import security
from app.db.session import SessionLocal
JWT_TOKEN_PREFIX = "Token" # noqa: S105... | uz | 0.233614 | # noqa: S105 | 2.243342 | 2 |
src/raiden_libs/contract_info.py | netcriptus/raiden-services | 13 | 5773 | <filename>src/raiden_libs/contract_info.py
import sys
from typing import Dict, List, Tuple
import structlog
from eth_utils import to_canonical_address
from raiden.utils.typing import Address, BlockNumber, ChainID, Optional
from raiden_contracts.contract_manager import (
ContractDevEnvironment,
ContractManager... | <filename>src/raiden_libs/contract_info.py
import sys
from typing import Dict, List, Tuple
import structlog
from eth_utils import to_canonical_address
from raiden.utils.typing import Address, BlockNumber, ChainID, Optional
from raiden_contracts.contract_manager import (
ContractDevEnvironment,
ContractManager... | en | 0.889735 | Returns contract addresses and start query block for a given chain and contracts version. The default contracts can be overwritten by the additional parameters. Args: chain_id: The chain id to look for deployed contracts. contracts: The list of contracts which should be considered addr... | 2.321622 | 2 |
meta_dataset/models/functional_classifiers.py | letyrodridc/meta-dataset | 0 | 5774 | # coding=utf-8
# Copyright 2022 The Meta-Dataset 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 ... | # coding=utf-8
# Copyright 2022 The Meta-Dataset 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 ... | en | 0.757769 | # coding=utf-8 # Copyright 2022 The Meta-Dataset 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 ... | 2.275603 | 2 |
app.py | Shrinidhi-C/Context-Based-Question-Answering | 16 | 5775 | <gh_stars>10-100
import os
import threading
import shutil
from datetime import timedelta, datetime
from flask import Flask, render_template, request, session, jsonify, url_for, redirect
from haystack.document_store.elasticsearch import *
from haystack.preprocessor.utils import convert_files_to_dicts
from haystack.prepr... | import os
import threading
import shutil
from datetime import timedelta, datetime
from flask import Flask, render_template, request, session, jsonify, url_for, redirect
from haystack.document_store.elasticsearch import *
from haystack.preprocessor.utils import convert_files_to_dicts
from haystack.preprocessor.cleaning ... | en | 0.813237 | # Replace with Elasticsearch(["http://elasticsearch:9200/"], verify_certs=True) to build docker image # Session Timeout in Minutes # User ID to keep track w.r.t sessions and context data # Used to store user id with time of login # Document store object of the user id # User settings for GPU and Pre-trained models choi... | 2.13102 | 2 |
timevortex/utils/filestorage.py | timevortexproject/timevortex | 0 | 5776 | #!/usr/bin/python3
# -*- coding: utf8 -*-
# -*- Mode: Python; py-indent-offset: 4 -*-
"""File storage adapter for timevortex project"""
import os
from os import listdir, makedirs
from os.path import isfile, join, exists
from time import tzname
from datetime import datetime
import pytz
import dateutil.parser
from djan... | #!/usr/bin/python3
# -*- coding: utf8 -*-
# -*- Mode: Python; py-indent-offset: 4 -*-
"""File storage adapter for timevortex project"""
import os
from os import listdir, makedirs
from os.path import isfile, join, exists
from time import tzname
from datetime import datetime
import pytz
import dateutil.parser
from djan... | en | 0.673296 | #!/usr/bin/python3 # -*- coding: utf8 -*- # -*- Mode: Python; py-indent-offset: 4 -*- File storage adapter for timevortex project Get lines number Get series per file Get last filename Update last file name Class that help us to store and load data over several file Constructor Insert series in DB :param s... | 2.383791 | 2 |
main_tg.py | olegush/quiz-bot | 0 | 5777 | <reponame>olegush/quiz-bot<filename>main_tg.py
import os
import logging
import logging.config
from functools import partial
from dotenv import load_dotenv
from telegram import Bot, ReplyKeyboardMarkup, ReplyKeyboardRemove
from telegram.ext import (Updater, CommandHandler, MessageHandler,
Regex... | import os
import logging
import logging.config
from functools import partial
from dotenv import load_dotenv
from telegram import Bot, ReplyKeyboardMarkup, ReplyKeyboardRemove
from telegram.ext import (Updater, CommandHandler, MessageHandler,
RegexHandler, ConversationHandler, Filters)
from red... | none | 1 | 2.203297 | 2 | |
tf_fourier_features/fourier_features_mlp.py | titu1994/tf_fourier_features | 37 | 5778 | import tensorflow as tf
from typing import Optional
from tf_fourier_features import fourier_features
class FourierFeatureMLP(tf.keras.Model):
def __init__(self, units: int, final_units: int, gaussian_projection: Optional[int],
activation: str = 'relu',
final_activation: str = "l... | import tensorflow as tf
from typing import Optional
from tf_fourier_features import fourier_features
class FourierFeatureMLP(tf.keras.Model):
def __init__(self, units: int, final_units: int, gaussian_projection: Optional[int],
activation: str = 'relu',
final_activation: str = "l... | en | 0.705752 | Fourier Feature Projection model from the paper [Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains](https://people.eecs.berkeley.edu/~bmild/fourfeat/). Used to create a multi-layer MLP with optional FourierFeatureProjection layer. Args: units: ... | 3.22345 | 3 |
eek/spider.py | fusionbox/eek | 5 | 5779 | <filename>eek/spider.py
import urlparse
import csv
import sys
import re
import collections
import time
import requests
from eek import robotparser # this project's version
from bs4 import BeautifulSoup
try:
import lxml
except ImportError:
HTML_PARSER = None
else:
HTML_PARSER = 'lxml'
encoding_re = re.c... | <filename>eek/spider.py
import urlparse
import csv
import sys
import re
import collections
import time
import requests
from eek import robotparser # this project's version
from bs4 import BeautifulSoup
try:
import lxml
except ImportError:
HTML_PARSER = None
else:
HTML_PARSER = 'lxml'
encoding_re = re.c... | en | 0.649813 | # this project's version Extracts the charset from a Content-Type header. >>> encoding_from_content_type('text/html; charset=utf-8') 'utf-8' >>> encoding_from_content_type('text/html') >>> We need to keep track of referers, but we don't want to add a url multiple times just because it was reference... | 2.724265 | 3 |
observations/r/zea_mays.py | hajime9652/observations | 199 | 5780 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def zea_mays(path):
"""Darwin's Heights of Cross- and ... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def zea_mays(path):
"""Darwin's Heights of Cross- and Self-fertilized Zea... | en | 0.849913 | # -*- coding: utf-8 -*- Darwin's Heights of Cross- and Self-fertilized Zea May Pairs Darwin (1876) studied the growth of pairs of zea may (aka corn) seedlings, one produced by cross-fertilization and the other produced by self-fertilization, but otherwise grown under identical conditions. His goal was to demon... | 3.346982 | 3 |
ois_api_client/v3_0/dto/Lines.py | peterkulik/ois_api_client | 7 | 5781 | <filename>ois_api_client/v3_0/dto/Lines.py
from typing import List
from dataclasses import dataclass
from .Line import Line
@dataclass
class Lines:
"""Product / service items
:param merged_item_indicator: Indicates whether the data exchange contains merged line data due to size reduction
:param line: Pro... | <filename>ois_api_client/v3_0/dto/Lines.py
from typing import List
from dataclasses import dataclass
from .Line import Line
@dataclass
class Lines:
"""Product / service items
:param merged_item_indicator: Indicates whether the data exchange contains merged line data due to size reduction
:param line: Pro... | en | 0.696354 | Product / service items :param merged_item_indicator: Indicates whether the data exchange contains merged line data due to size reduction :param line: Product / service item | 1.865547 | 2 |
parsing_documents.py | leylafenix/belief-network-irs | 0 | 5782 | <filename>parsing_documents.py<gh_stars>0
__author__ = '<NAME>'
import os
import pprint
def read_block(f):
s = ""
line = f.readline()
while line and not line.startswith("."):
s += line
line = f.readline()
return s, line
def read_doc(f):
doc = {"title": "", "autho... | <filename>parsing_documents.py<gh_stars>0
__author__ = '<NAME>'
import os
import pprint
def read_block(f):
s = ""
line = f.readline()
while line and not line.startswith("."):
s += line
line = f.readline()
return s, line
def read_doc(f):
doc = {"title": "", "autho... | es | 0.434569 | # .I # print("**********************************") # averiguar como preguntar si una carpeta o fichero existe en python | 3.186199 | 3 |
groups/admin.py | caktus/rapidsms-groups | 1 | 5783 | <reponame>caktus/rapidsms-groups<gh_stars>1-10
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from django.contrib import admin
from groups.models import Group
admin.site.register(Group)
| #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from django.contrib import admin
from groups.models import Group
admin.site.register(Group) | fr | 0.262832 | #!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 | 1.142111 | 1 |
avod/datasets/kitti/kitti_aug_test.py | Ascend-Huawei/AVOD | 0 | 5784 | # Copyright 2017 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 2017 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.829824 | # Copyright 2017 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.414855 | 1 |
application/model/_base.py | keysona/blog | 0 | 5785 | <gh_stars>0
from flask_sqlalchemy import SQLAlchemy, Model
# class BaseModel(Model):
# def save(self):
# db.session.add(self)
# db.session.commit(self)
# def delete(self):
# db.session.
db = SQLAlchemy()
| from flask_sqlalchemy import SQLAlchemy, Model
# class BaseModel(Model):
# def save(self):
# db.session.add(self)
# db.session.commit(self)
# def delete(self):
# db.session.
db = SQLAlchemy() | en | 0.194901 | # class BaseModel(Model): # def save(self): # db.session.add(self) # db.session.commit(self) # def delete(self): # db.session. | 2.686257 | 3 |
kvmagent/kvmagent/plugins/prometheus.py | qianfei11/zstack-utility | 0 | 5786 | <filename>kvmagent/kvmagent/plugins/prometheus.py
import os.path
import threading
import typing
from prometheus_client import start_http_server
from prometheus_client.core import GaugeMetricFamily, REGISTRY
from kvmagent import kvmagent
from zstacklib.utils import http
from zstacklib.utils import jsonobject
from zsta... | <filename>kvmagent/kvmagent/plugins/prometheus.py
import os.path
import threading
import typing
from prometheus_client import start_http_server
from prometheus_client.core import GaugeMetricFamily, REGISTRY
from kvmagent import kvmagent
from zstacklib.utils import http
from zstacklib.utils import jsonobject
from zsta... | en | 0.347504 | # type: Dict[str, threading.Thread] #|^[[:space:]]*$' /etc/multipath/wwids") :type state: str :type state: str # type: (int, str) # NOTE(weiw): sriov nic contains carrier file but can not read pid_vm_map_str samples: 38149 e8e6f27bfb2d47e08c59cbea1d0488c3 38232 afa02edca7eb4afcb5d2904ac1216eb1 # NOTE(weiw): som... | 1.895721 | 2 |
recipes/libstudxml/all/conanfile.py | rockandsalt/conan-center-index | 562 | 5787 | from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools
from conans.errors import ConanInvalidConfiguration
import os
import shutil
required_conan_version = ">=1.33.0"
class LibStudXmlConan(ConanFile):
name = "libstudxml"
description = "A streaming XML pull parser and streaming XML serializer... | from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools
from conans.errors import ConanInvalidConfiguration
import os
import shutil
required_conan_version = ">=1.33.0"
class LibStudXmlConan(ConanFile):
name = "libstudxml"
description = "A streaming XML pull parser and streaming XML serializer... | en | 0.953531 | # libc++ includes a file called 'version', and since libstudxml adds source_subfolder as an # include dir, libc++ ends up including their 'version' file instead, causing a compile error # If built with makefile, static library mechanism is provided by their buildsystem already | 1.923255 | 2 |
dataset/WebCariA.py | KeleiHe/DAAN | 9 | 5788 |
# Copyright 2020 <NAME> & <NAME> (<EMAIL>)
# 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 a... |
# Copyright 2020 <NAME> & <NAME> (<EMAIL>)
# 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 a... | en | 0.840891 | # Copyright 2020 <NAME> & <NAME> (<EMAIL>) # 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... | 2.126145 | 2 |
moonworm/crawler/state/json_state.py | zomglings/moonworm | 10 | 5789 | <reponame>zomglings/moonworm<gh_stars>1-10
import datetime
import json
import time
from typing import Optional
from web3.datastructures import AttributeDict
from .event_scanner_state import EventScannerState
class JSONifiedState(EventScannerState):
"""Store the state of scanned blocks and all events.
All s... | import datetime
import json
import time
from typing import Optional
from web3.datastructures import AttributeDict
from .event_scanner_state import EventScannerState
class JSONifiedState(EventScannerState):
"""Store the state of scanned blocks and all events.
All state is an in-memory dict.
Simple load/... | en | 0.905569 | Store the state of scanned blocks and all events. All state is an in-memory dict. Simple load/store massive JSON on start up. # How many second ago we saved the JSON file Create initial state of nothing scanned. Restore the last scan state from a file. Save everything we have scanned so far in a file. # # Even... | 2.705481 | 3 |
npbench/benchmarks/nbody/nbody_dace.py | frahlg/npbench | 27 | 5790 | <reponame>frahlg/npbench<filename>npbench/benchmarks/nbody/nbody_dace.py
# Adapted from https://github.com/pmocz/nbody-python/blob/master/nbody.py
# TODO: Add GPL-3.0 License
import numpy as np
import dace as dc
"""
Create Your Own N-body Simulation (With Python)
<NAME> (2020) Princeton Univeristy, @PMocz
Simulate orb... | # Adapted from https://github.com/pmocz/nbody-python/blob/master/nbody.py
# TODO: Add GPL-3.0 License
import numpy as np
import dace as dc
"""
Create Your Own N-body Simulation (With Python)
<NAME> (2020) Princeton Univeristy, @PMocz
Simulate orbits of stars interacting due to gravity
Code calculates pairwise forces a... | en | 0.719436 | # Adapted from https://github.com/pmocz/nbody-python/blob/master/nbody.py # TODO: Add GPL-3.0 License Create Your Own N-body Simulation (With Python) <NAME> (2020) Princeton Univeristy, @PMocz Simulate orbits of stars interacting due to gravity Code calculates pairwise forces according to Newton's Law of Gravity # @dc.... | 3.437212 | 3 |
application/__init__.py | Healthy-Kokoro/Hiroshima | 0 | 5791 | <gh_stars>0
# Third-party imports
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
configurations = {
'development': 'configurations.DevelopmentConfiguration',
'testing': 'configurations.TestingConfiguration',
'staging': 'configurations.StagingConfiguration',
'production': 'configurations.Production... | # Third-party imports
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
configurations = {
'development': 'configurations.DevelopmentConfiguration',
'testing': 'configurations.TestingConfiguration',
'staging': 'configurations.StagingConfiguration',
'production': 'configurations.ProductionConfiguratio... | en | 0.839697 | # Third-party imports | 1.957181 | 2 |
lesson5/exceptions_except.py | drednout/letspython | 1 | 5792 | def take_beer(fridge, number=1):
if "beer" not in fridge:
raise Exception("No beer at all:(")
if number > fridge["beer"]:
raise Exception("Not enough beer:(")
fridge["beer"] -= number
if __name__ == "__main__":
fridge = {
"beer": 2,
"milk": 1,
"meat": 3,
}... | def take_beer(fridge, number=1):
if "beer" not in fridge:
raise Exception("No beer at all:(")
if number > fridge["beer"]:
raise Exception("Not enough beer:(")
fridge["beer"] -= number
if __name__ == "__main__":
fridge = {
"beer": 2,
"milk": 1,
"meat": 3,
}... | none | 1 | 3.978544 | 4 | |
icfs/filesystem/exceptions.py | bhanupratapjain/icfs | 0 | 5793 | class ICFSError(IOError):
"""Error while making any filesystem API requests."""
| class ICFSError(IOError):
"""Error while making any filesystem API requests."""
| en | 0.711669 | Error while making any filesystem API requests. | 1.575623 | 2 |
synapse/storage/data_stores/state/store.py | juhovan/synapse | 1 | 5794 | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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 applicab... | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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 applicab... | en | 0.888565 | # -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # # 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 applicab... | 1.852473 | 2 |
core/migrations/0011_itemvariation_variation.py | manulangat1/djcommerce | 1 | 5795 | # Generated by Django 2.2.6 on 2020-02-09 12:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20200130_1135'),
]
operations = [
migrations.CreateModel(
name='Variation',
... | # Generated by Django 2.2.6 on 2020-02-09 12:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20200130_1135'),
]
operations = [
migrations.CreateModel(
name='Variation',
... | en | 0.80949 | # Generated by Django 2.2.6 on 2020-02-09 12:24 | 1.706984 | 2 |
mnist/convolutional.py | Colins-Ford/mnist-webapp | 0 | 5796 | import os
from mnist import model
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets("data/dataset/", one_hot=True)
# model
with tf.variable_scope("convolutional"):
x = tf.placeholder(tf.float32, [None, 784])
keep_prob = tf.placeholder(tf.float... | import os
from mnist import model
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets("data/dataset/", one_hot=True)
# model
with tf.variable_scope("convolutional"):
x = tf.placeholder(tf.float32, [None, 784])
keep_prob = tf.placeholder(tf.float... | en | 0.842973 | # model # train | 3.137394 | 3 |
parse_scripts/import_osm.py | nokout/au_address | 1 | 5797 | import requests
import codecs
query1 = """<union>
<query type="way">
<has-kv k="addr:housenumber"/>
<has-kv k="addr:street:name"/>
<has-kv k="addr:street:type"/>
<has-kv k="addr:state"/>
<bbox-query e="%s" n="%s" s="%s" w="%s"/>
</query>
<query type="way">
<has-kv k="addr:housenumber"/>
<ha... | import requests
import codecs
query1 = """<union>
<query type="way">
<has-kv k="addr:housenumber"/>
<has-kv k="addr:street:name"/>
<has-kv k="addr:street:type"/>
<has-kv k="addr:state"/>
<bbox-query e="%s" n="%s" s="%s" w="%s"/>
</query>
<query type="way">
<has-kv k="addr:housenumber"/>
<ha... | en | 0.175041 | <union> <query type="way"> <has-kv k="addr:housenumber"/> <has-kv k="addr:street:name"/> <has-kv k="addr:street:type"/> <has-kv k="addr:state"/> <bbox-query e="%s" n="%s" s="%s" w="%s"/> </query> <query type="way"> <has-kv k="addr:housenumber"/> <has-kv k="addr:street:name"/> <has-kv k="... | 2.188992 | 2 |
tools/test_net_batch.py | abhirevan/pedestrian-detector | 0 | 5798 | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
"""Test a Fast R-CNN network on an image database."""
... | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
"""Test a Fast R-CNN network on an image database."""
... | en | 0.424196 | #!/usr/bin/env python # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- Test a Fast R-CNN network on an image database. # sentine... | 2.365089 | 2 |
mygallary/urls.py | mangowilliam/my_gallary | 0 | 5799 | <gh_stars>0
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import url
from . import views
urlpatterns = [
url('^$', views.gallary,name = 'gallary'),
url(r'^search/', views.search_image, name='search_image'),
url(r'^details/(\d+)',views.search_location,na... | from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import url
from . import views
urlpatterns = [
url('^$', views.gallary,name = 'gallary'),
url(r'^search/', views.search_image, name='search_image'),
url(r'^details/(\d+)',views.search_location,name ='images'... | none | 1 | 1.791916 | 2 |