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 |
|---|---|---|---|---|---|---|---|---|---|---|
Library.py | verkaufer/CliLibrary | 0 | 6631151 | import argparse
#import library as Library
from Book import Book
from Bookshelf import Bookshelf
bookshelf = Bookshelf()
def addBook(args):
book = Book(args.title, args.author)
bookshelf.add(book)
def removeBook(args):
if(args.all):
print "all books"
elif(args.title):
print "remove bo... | import argparse
#import library as Library
from Book import Book
from Bookshelf import Bookshelf
bookshelf = Bookshelf()
def addBook(args):
book = Book(args.title, args.author)
bookshelf.add(book)
def removeBook(args):
if(args.all):
print "all books"
elif(args.title):
print "remove bo... | en | 0.56992 | #import library as Library ## Add book ## Remove book(s) ## this will print 'hello' and the -title argument ## Read book ## Show book(s) # Bookmark book ## final setup #print args | 3.640239 | 4 |
clickhouse/tests/test_clickhouse.py | isaachui/integrations-core | 0 | 6631152 | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.clickhouse import ClickhouseCheck
from .common import CLICKHOUSE_VERSION
from .metrics import ALL_METRICS
pytestmark = [pytest.mark.integration, pytest.mark.usefixtures... | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.clickhouse import ClickhouseCheck
from .common import CLICKHOUSE_VERSION
from .metrics import ALL_METRICS
pytestmark = [pytest.mark.integration, pytest.mark.usefixtures... | en | 0.807738 | # (C) Datadog, Inc. 2019-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) # We do not do aggregator.assert_all_metrics_covered() because depending on timing, some other metrics may appear Regression test: a copy of the `can_connect` service check must be submitted for each check... | 2.118991 | 2 |
tests/test_message_handler/test_strategies/test_handle_rpc_query_message.py | Zapix/mtpylon | 9 | 6631153 | <reponame>Zapix/mtpylon
# -*- coding: utf-8 -*-
from unittest.mock import patch, MagicMock, AsyncMock
import pytest
from mtpylon import long
from mtpylon.messages import EncryptedMessage
from mtpylon.serialization import CallableFunc
from mtpylon.message_handler.strategies.handle_rpc_query_message import (
handle... | # -*- coding: utf-8 -*-
from unittest.mock import patch, MagicMock, AsyncMock
import pytest
from mtpylon import long
from mtpylon.messages import EncryptedMessage
from mtpylon.serialization import CallableFunc
from mtpylon.message_handler.strategies.handle_rpc_query_message import (
handle_rpc_query_message,
... | en | 0.744791 | # -*- coding: utf-8 -*- # noqa | 2.026654 | 2 |
setup.py | MikeSmithLabTeam/particletracker | 2 | 6631154 | <gh_stars>1-10
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='particletracker',
version='2.0',
packages=setuptools.find_packages(
exclude=('tests', 'docs')
),
url='https://github.com/MikeSmithLabTeam/particletracker',
insta... | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='particletracker',
version='2.0',
packages=setuptools.find_packages(
exclude=('tests', 'docs')
),
url='https://github.com/MikeSmithLabTeam/particletracker',
install_requires=[
... | en | 0.318585 | # dependency_links=[ # 'https://github.com/MikeSmithLabTeam/labvision/tarball/repo/master#egg=package-1.0', # 'https://github.com/MikeSmithLabTeam/filehandling/tarball/repo/master#egg=package-1.0', # ], | 1.188243 | 1 |
build/lib/gradio/outputs.py | Chetan8000/gradio | 1 | 6631155 | <filename>build/lib/gradio/outputs.py
"""
This module defines various classes that can serve as the `output` to an interface. Each class must inherit from
`AbstractOutput`, and each class must define a path to its template. All of the subclasses of `AbstractOutput` are
automatically added to a registry, which allows th... | <filename>build/lib/gradio/outputs.py
"""
This module defines various classes that can serve as the `output` to an interface. Each class must inherit from
`AbstractOutput`, and each class must define a path to its template. All of the subclasses of `AbstractOutput` are
automatically added to a registry, which allows th... | en | 0.831247 | This module defines various classes that can serve as the `output` to an interface. Each class must inherit from `AbstractOutput`, and each class must define a path to its template. All of the subclasses of `AbstractOutput` are automatically added to a registry, which allows them to be easily referenced in other parts ... | 2.455218 | 2 |
enforce_constants/transformer.py | aroberge/import-experiments | 0 | 6631156 | <reponame>aroberge/import-experiments
import re
# For this example, we use simple regular expressions to identify
# lines of code that correspond to variable assignments. It is assumed
# that each assignment is done on a single line of code.
# This approach can change values within triple-quoted strings
# and does not... | import re
# For this example, we use simple regular expressions to identify
# lines of code that correspond to variable assignments. It is assumed
# that each assignment is done on a single line of code.
# This approach can change values within triple-quoted strings
# and does not capture all the possible cases for va... | en | 0.911405 | # For this example, we use simple regular expressions to identify # lines of code that correspond to variable assignments. It is assumed # that each assignment is done on a single line of code. # This approach can change values within triple-quoted strings # and does not capture all the possible cases for variable assi... | 3.811078 | 4 |
cosmos/galaxies/settings/__init__.py | MrFreemanser/Bot | 0 | 6631157 | from .administrator import AdministratorSettings
__all__ = [
AdministratorSettings,
]
def setup(bot):
bot.plugins.setup(__file__)
| from .administrator import AdministratorSettings
__all__ = [
AdministratorSettings,
]
def setup(bot):
bot.plugins.setup(__file__)
| none | 1 | 1.261777 | 1 | |
hedgehog/bayes_net.py | dormanh/hedgehog | 0 | 6631158 | <reponame>dormanh/hedgehog
import collections
import functools
import itertools
import graphlib
import queue
import typing
import numpy as np
import pandas as pd
import vose
__all__ = ['BayesNet']
@pd.api.extensions.register_series_accessor('cdt')
class CDTAccessor:
"""
Adds utilities to a pandas.Series t... | import collections
import functools
import itertools
import graphlib
import queue
import typing
import numpy as np
import pandas as pd
import vose
__all__ = ['BayesNet']
@pd.api.extensions.register_series_accessor('cdt')
class CDTAccessor:
"""
Adds utilities to a pandas.Series to help manipulate it as a c... | en | 0.822094 | Adds utilities to a pandas.Series to help manipulate it as a conditional probability table (CDT). Sample a row at random. The `sample` method of a Series is very slow. Additionally, it is not designed to be used repetitively and requires O(n) steps every time it is called. Instead, we use a Cython ... | 2.590957 | 3 |
Object Oriented Programming/EmployeeClass.py | Williano/Solved-Practice-Questions | 0 | 6631159 | # Module: EmployeeClass.py
# Description: This module creates an Employee Class with data attributes
# and methods acting on the data.
# Programmer: <NAME>.
# Date: 01.03.17
class Employee:
"""Creating the Employee class with data attributes and methods.
"""
# Defining the __init__ method initi... | # Module: EmployeeClass.py
# Description: This module creates an Employee Class with data attributes
# and methods acting on the data.
# Programmer: <NAME>.
# Date: 01.03.17
class Employee:
"""Creating the Employee class with data attributes and methods.
"""
# Defining the __init__ method initi... | en | 0.706458 | # Module: EmployeeClass.py # Description: This module creates an Employee Class with data attributes # and methods acting on the data. # Programmer: <NAME>. # Date: 01.03.17 Creating the Employee class with data attributes and methods. # Defining the __init__ method initializes the attributes. # Defining t... | 4.161837 | 4 |
pubnub/endpoints/access/revoke.py | KaizenAPI/python | 4 | 6631160 | <filename>pubnub/endpoints/access/revoke.py<gh_stars>1-10
from pubnub.endpoints.access.grant import Grant
from pubnub.enums import PNOperationType
class Revoke(Grant):
def __init__(self, pubnub):
Grant.__init__(self, pubnub)
self._read = False
self._write = False
self._manage = Fal... | <filename>pubnub/endpoints/access/revoke.py<gh_stars>1-10
from pubnub.endpoints.access.grant import Grant
from pubnub.enums import PNOperationType
class Revoke(Grant):
def __init__(self, pubnub):
Grant.__init__(self, pubnub)
self._read = False
self._write = False
self._manage = Fal... | none | 1 | 2.386356 | 2 | |
src/ralph/backends/mixins.py | p-bizouard/ralph | 5 | 6631161 | """Backend mixins for Ralph"""
import json
import logging
from ralph.defaults import HISTORY_FILE, LOCALE_ENCODING
logger = logging.getLogger(__name__)
class HistoryMixin:
"""Handle backend download history to avoid fetching same files multiple
times if they are already available."""
@property
def... | """Backend mixins for Ralph"""
import json
import logging
from ralph.defaults import HISTORY_FILE, LOCALE_ENCODING
logger = logging.getLogger(__name__)
class HistoryMixin:
"""Handle backend download history to avoid fetching same files multiple
times if they are already available."""
@property
def... | en | 0.882541 | Backend mixins for Ralph Handle backend download history to avoid fetching same files multiple times if they are already available. Get backend history # pylint: disable=no-self-use Write given history as a JSON file # Update history Clean selected events from the history. selector: a callable that selects... | 2.703999 | 3 |
v2/log_reader.py | h3nrikoo/system_on_sheep | 0 | 6631162 | from collections import namedtuple
from datetime import datetime
import folium
import webbrowser
import statistics
import random
import math
import numpy as np
import matplotlib.pyplot as plt
from geopy import distance
import pprint
center_coordinates = [63.406514, 10.476741]
CSV_TYPE = 0
CSV_TYPE_GPS = "GPS"
CSV_TYP... | from collections import namedtuple
from datetime import datetime
import folium
import webbrowser
import statistics
import random
import math
import numpy as np
import matplotlib.pyplot as plt
from geopy import distance
import pprint
center_coordinates = [63.406514, 10.476741]
CSV_TYPE = 0
CSV_TYPE_GPS = "GPS"
CSV_TYP... | none | 1 | 2.777218 | 3 | |
evennia/contrib/tutorials/__init__.py | davidrideout/evennia | 0 | 6631163 | """
Contribs acting as tutorials, examples or supporting the documentation.
"""
| """
Contribs acting as tutorials, examples or supporting the documentation.
"""
| en | 0.96151 | Contribs acting as tutorials, examples or supporting the documentation. | 1.4098 | 1 |
level20.py | CoffeeTableEnnui/RedCircleGame | 0 | 6631164 | import rectangles as r
import circles as c
import games as g
import pygame
level = g.Game(724, 76, 724, 724)
level.addwall(102,750,102,698)
| import rectangles as r
import circles as c
import games as g
import pygame
level = g.Game(724, 76, 724, 724)
level.addwall(102,750,102,698)
| none | 1 | 2.613673 | 3 | |
ModelerFolder/PlotBuilder.py | KTH-UrbanT/MUBES_UBEM | 8 | 6631165 | <gh_stars>1-10
# @Author : <NAME>
# @Email : <EMAIL>
import os
import sys
path2addgeom = os.path.join(os.path.dirname(os.path.dirname(os.getcwd())), 'geomeppy')
sys.path.append(path2addgeom)
sys.path.append("..")
import CoreFiles.GeneralFunctions as GrlFct
from BuildObject.DB_Building import BuildingList
import Bu... | # @Author : <NAME>
# @Email : <EMAIL>
import os
import sys
path2addgeom = os.path.join(os.path.dirname(os.path.dirname(os.getcwd())), 'geomeppy')
sys.path.append(path2addgeom)
sys.path.append("..")
import CoreFiles.GeneralFunctions as GrlFct
from BuildObject.DB_Building import BuildingList
import BuildObject.DB_Da... | en | 0.526491 | # @Author : <NAME> # @Email : <EMAIL> # process is launched for the considered building ############################################') # lets build the two main object we'll be playing with in the following' # Rounds of check if we continue with this building or not, see DB_Filter4Simulation.py if other filter are t... | 2.026158 | 2 |
2_if.py | dev-gmmahs/python-example | 0 | 6631166 | # 2. 조건문 if 사용법
a = 10
b = 12
if a is b:
print("a와 b는 같습니다")
else:
print("a와 b는 다릅니다")
str1 = "안녕"
str2 = "안녕"
# is 또는 ==
if str1 is str2:
print("str1와 str2는 같습니다")
else:
print("str1와 str2는 다릅니다")
user_id = "asd1234"
user_password = ""
if not (user_id and user_password):
print("아이디와 패스워드 모두 ... | # 2. 조건문 if 사용법
a = 10
b = 12
if a is b:
print("a와 b는 같습니다")
else:
print("a와 b는 다릅니다")
str1 = "안녕"
str2 = "안녕"
# is 또는 ==
if str1 is str2:
print("str1와 str2는 같습니다")
else:
print("str1와 str2는 다릅니다")
user_id = "asd1234"
user_password = ""
if not (user_id and user_password):
print("아이디와 패스워드 모두 ... | ko | 0.999503 | # 2. 조건문 if 사용법 # is 또는 == | 3.813934 | 4 |
tests/unittests/dumptools/test_var2mod.py | moschams/padl | 0 | 6631167 | import ast
from padl.dumptools import var2mod
class TestFindGlobals:
def test_find_same_name(self):
statement = 'a = run(a)'
tree = ast.parse(statement)
res = var2mod.find_globals(tree)
assert res == {('a', 1), ('run', 0)}
def test_find_in_assignment(self):
statement ... | import ast
from padl.dumptools import var2mod
class TestFindGlobals:
def test_find_same_name(self):
statement = 'a = run(a)'
tree = ast.parse(statement)
res = var2mod.find_globals(tree)
assert res == {('a', 1), ('run', 0)}
def test_find_in_assignment(self):
statement ... | none | 1 | 2.481836 | 2 | |
DataScience/Matplotlib.py | AlPus108/Python_lessons | 0 | 6631168 | import numpy as np
import matplotlib.pyplot as plt
# pyplot - ключевой модуль библиотеки matplotlib
# Рисуем ф-ю y = x**2 * e**(-)x**2
# Создаем равномерно распределенное множество
X = np.linspace(0, 3, 1001, dtype=np.float32)
print(X) # [0. 0.003 0.006 ... 2.994 2.997 3. ]
# Возведем 'x' в квадрат
print(X*... | import numpy as np
import matplotlib.pyplot as plt
# pyplot - ключевой модуль библиотеки matplotlib
# Рисуем ф-ю y = x**2 * e**(-)x**2
# Создаем равномерно распределенное множество
X = np.linspace(0, 3, 1001, dtype=np.float32)
print(X) # [0. 0.003 0.006 ... 2.994 2.997 3. ]
# Возведем 'x' в квадрат
print(X*... | ru | 0.976292 | # pyplot - ключевой модуль библиотеки matplotlib # Рисуем ф-ю y = x**2 * e**(-)x**2 # Создаем равномерно распределенное множество # [0. 0.003 0.006 ... 2.994 2.997 3. ] # Возведем 'x' в квадрат # [0.000000e+00 9.000000e-06 3.600000e-05 ... 8.964036e+00 8.982009e+00 # 9.000000e+00] # Операция происходит над каждым... | 3.722407 | 4 |
examples/osrt_python/tvm_dlr/dlr_inference_example.py | LaudateCorpus1/edgeai-tidl-tools | 15 | 6631169 | <reponame>LaudateCorpus1/edgeai-tidl-tools
import time
import platform
import os
def load_labels():
with open('../../../test_data/labels.txt', 'r') as f:
return [line.strip() for line in f.readlines()]
if platform.machine() == 'aarch64':
numImages = 100
else :
numImages = 3
# preprocessing / postproce... | import time
import platform
import os
def load_labels():
with open('../../../test_data/labels.txt', 'r') as f:
return [line.strip() for line in f.readlines()]
if platform.machine() == 'aarch64':
numImages = 100
else :
numImages = 3
# preprocessing / postprocessing for tflite model
def preprocess_for_t... | en | 0.797437 | # preprocessing / postprocessing for tflite model # read the image using openCV # convert to RGB # This TFLite model is trained using 299x299 images. # The general rule of thumb for classification models # is to scale the input image while preserving # the original aspect ratio, so we scale the short edge # to 299 pixe... | 2.940656 | 3 |
RemoteNAO-client-host/nao_remotenao/scripts/teleop_rn.py | anoxil/RemoteNAO | 0 | 6631170 | <reponame>anoxil/RemoteNAO<filename>RemoteNAO-client-host/nao_remotenao/scripts/teleop_rn.py<gh_stars>0
#!/usr/bin/env python
import rospy, subprocess
from socketIO_client_nexus import SocketIO
from geometry_msgs.msg import Twist, Vector3
socketIO = SocketIO('https://remote-nao.herokuapp.com')
linear_x = 0
angular... | #!/usr/bin/env python
import rospy, subprocess
from socketIO_client_nexus import SocketIO
from geometry_msgs.msg import Twist, Vector3
socketIO = SocketIO('https://remote-nao.herokuapp.com')
linear_x = 0
angular_z = 0
def changeMovement(*args):
"""Function which modifies the linear and angular velocity of the... | en | 0.631247 | #!/usr/bin/env python Function which modifies the linear and angular velocity of the robot while not rospy.is_shutdown(): print("xxxxxx") rate.sleep() | 2.518913 | 3 |
mycroft/api/__init__.py | sotirisspyrou/mycroft-core | 1 | 6631171 | <reponame>sotirisspyrou/mycroft-core
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | en | 0.781634 | # Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin... | 1.896276 | 2 |
egs/yesno/ASR/transducer/test_transducer.py | TIFOSI528/icefall | 173 | 6631172 | <reponame>TIFOSI528/icefall<filename>egs/yesno/ASR/transducer/test_transducer.py
#!/usr/bin/env python3
# Copyright 2021 Xiaomi Corp. (authors: <NAME>)
#
# See ../../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not us... | #!/usr/bin/env python3
# Copyright 2021 Xiaomi Corp. (authors: <NAME>)
#
# See ../../../../LICENSE for clarification regarding multiple 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... | en | 0.770807 | #!/usr/bin/env python3 # Copyright 2021 Xiaomi Corp. (authors: <NAME>) # # See ../../../../LICENSE for clarification regarding multiple 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... | 2.321594 | 2 |
stubs.min/Autodesk/Revit/DB/Structure/__init___parts/RebarShapeConstraintSagittaLength.py | hdm-dt-fb/ironpython-stubs | 1 | 6631173 | <reponame>hdm-dt-fb/ironpython-stubs<filename>stubs.min/Autodesk/Revit/DB/Structure/__init___parts/RebarShapeConstraintSagittaLength.py
class RebarShapeConstraintSagittaLength(RebarShapeConstraint,IDisposable):
"""
A constraint that can be applied to a RebarShapeDefinitionByArc
and drives the height of the ar... | class RebarShapeConstraintSagittaLength(RebarShapeConstraint,IDisposable):
"""
A constraint that can be applied to a RebarShapeDefinitionByArc
and drives the height of the arc.
RebarShapeConstraintSagittaLength(paramId: ElementId)
"""
def Dispose(self):
""" Dispose(self: RebarShapeConstraint,A_0... | en | 0.490677 | A constraint that can be applied to a RebarShapeDefinitionByArc
and drives the height of the arc.
RebarShapeConstraintSagittaLength(paramId: ElementId) Dispose(self: RebarShapeConstraint,A_0: bool) ReleaseUnmanagedResources(self: RebarShapeConstraint,disposing: bool) __enter__(self: IDisposable) -> object ... | 2.089741 | 2 |
setup.py | ghl3/AlphaFour | 0 | 6631174 | <gh_stars>0
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from os import path
# io.open is needed for projects that support Python 2.7
# It... | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from os import path
# io.open is needed for projects that support Python 2.7
# It ensures ope... | en | 0.773672 | A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject # Always prefer setuptools over distutils # io.open is needed for projects that support Python 2.7 # It ensures open() defaults to text mode with universal newlines, # and accepts an argu... | 1.840652 | 2 |
examples/plotting/server/timeout.py | DuCorey/bokeh | 1 | 6631175 | <filename>examples/plotting/server/timeout.py
import sys
import numpy as np
from bokeh.client import push_session
from bokeh.palettes import RdYlBu3
from bokeh.plotting import figure, curdoc
N = 50
p = figure(x_range=(0, 100), y_range=(0, 100), toolbar_location=None)
p.border_fill_color = 'black'
p.background_fill... | <filename>examples/plotting/server/timeout.py
import sys
import numpy as np
from bokeh.client import push_session
from bokeh.palettes import RdYlBu3
from bokeh.plotting import figure, curdoc
N = 50
p = figure(x_range=(0, 100), y_range=(0, 100), toolbar_location=None)
p.border_fill_color = 'black'
p.background_fill... | none | 1 | 2.656828 | 3 | |
kpc_connector_utils/connector_mssql/config.py | praiwann/kpc-connector-utils | 0 | 6631176 | <filename>kpc_connector_utils/connector_mssql/config.py
from kpc_connector_utils.pusher_s3.config import BasePutS3Config
from kpc_connector_utils.common.base64 import base64_encode as encode
import json
class ConnectorMSSql(BasePutS3Config):
def __init__(self, mssql_connector_env):
super().__init__(mssql... | <filename>kpc_connector_utils/connector_mssql/config.py
from kpc_connector_utils.pusher_s3.config import BasePutS3Config
from kpc_connector_utils.common.base64 import base64_encode as encode
import json
class ConnectorMSSql(BasePutS3Config):
def __init__(self, mssql_connector_env):
super().__init__(mssql... | none | 1 | 2.114216 | 2 | |
demo_pandas/dataframe_basic_7_selected_simple.py | caserwin/daily-learning-python | 1 | 6631177 | # -*- coding: utf-8 -*-
# @Time : 2018/10/3 下午2:36
# @Author : yidxue
import pandas as pd
from common.util_function import *
data = [[1, 2, 3, 4],
[4, 5, 6, 8],
[2, 3, 5, 9]]
df = pd.DataFrame(data=data, index=['a', 'b', 'c'], columns=['A', 'B', 'C', 'D'])
print_line("[]使用示例:根据column name获取")
prin... | # -*- coding: utf-8 -*-
# @Time : 2018/10/3 下午2:36
# @Author : yidxue
import pandas as pd
from common.util_function import *
data = [[1, 2, 3, 4],
[4, 5, 6, 8],
[2, 3, 5, 9]]
df = pd.DataFrame(data=data, index=['a', 'b', 'c'], columns=['A', 'B', 'C', 'D'])
print_line("[]使用示例:根据column name获取")
prin... | zh | 0.467831 | # -*- coding: utf-8 -*- # @Time : 2018/10/3 下午2:36 # @Author : yidxue # 取出A列 # 取出A,B两列 # 取出前2行 | 3.580591 | 4 |
qa/web_tests/tests/keypairs/test_import_keypair.py | robertstarmer/aurora | 23 | 6631178 | <gh_stars>10-100
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from random import randint
import unittest
from qa.web_tests import config
class TestImportK... | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from random import randint
import unittest
from qa.web_tests import config
class TestImportKeypairs(unittest.... | none | 1 | 2.515914 | 3 | |
frappe/website/doctype/blogger/test_blogger.py | pawaranand/phr_frappe | 1 | 6631179 | <filename>frappe/website/doctype/blogger/test_blogger.py
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
test_records = frappe.get_test_records('Blogger') | <filename>frappe/website/doctype/blogger/test_blogger.py
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
test_records = frappe.get_test_records('Blogger') | en | 0.587297 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt | 1.10133 | 1 |
AdminServer/tests/test_service_manager.py | whoarethebritons/appscale | 0 | 6631180 | <reponame>whoarethebritons/appscale<filename>AdminServer/tests/test_service_manager.py
from collections import namedtuple
from mock import MagicMock, mock_open, patch
from tornado.gen import Future
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import AsyncTestCase, gen_test
from appscale.admin.s... | from collections import namedtuple
from mock import MagicMock, mock_open, patch
from tornado.gen import Future
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import AsyncTestCase, gen_test
from appscale.admin.service_manager import (
DatastoreServer, gen, options, psutil, ServerStates, ServiceM... | en | 0.922708 | # Skip sleep calls. # Test that a Datastore server process is started. # Test that the server attributes are parsed correctly. # Test that server objects are created with the correct PIDs. # Test that servers are started when scheduled. | 2.134691 | 2 |
skilltree/models.py | ulope/eve_skill_tree | 1 | 6631181 | from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Model, CharField, ForeignKey, BooleanField, TextField, PositiveSmallIntegerField, ManyToManyField
from django_extensions.db.models import TimeStampedModel
from zope.interface.exceptions import DoesNotImplement
class SkillGroup(TimeStamp... | from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Model, CharField, ForeignKey, BooleanField, TextField, PositiveSmallIntegerField, ManyToManyField
from django_extensions.db.models import TimeStampedModel
from zope.interface.exceptions import DoesNotImplement
class SkillGroup(TimeStamp... | none | 1 | 2.214718 | 2 | |
tests/test_mul.py | drLis/SolidityHomomorphicHiding | 0 | 6631182 | <reponame>drLis/SolidityHomomorphicHiding
import pytest
import brownie
def test_mul(test):
e1 = test.e(1)
k = 777
e2 = test.e(1 * 777)
prod = test.mul(e1[0], e1[1], k)
assert e2[0] == prod[0] and e2[1] == prod[1] | import pytest
import brownie
def test_mul(test):
e1 = test.e(1)
k = 777
e2 = test.e(1 * 777)
prod = test.mul(e1[0], e1[1], k)
assert e2[0] == prod[0] and e2[1] == prod[1] | none | 1 | 2.402582 | 2 | |
examples/create_scripts/interface-e.py | bendichter/api-python | 32 | 6631183 | <reponame>bendichter/api-python
#!/usr/bin/python
import sys
from nwb import nwb_file
from nwb import nwb_utils as utils
"""
Example extending the format: creating a new Interface.
This example uses two extensions defined in director "extensions"
e-interface.py - defines Interface extension
e-timeseries.py - d... | #!/usr/bin/python
import sys
from nwb import nwb_file
from nwb import nwb_utils as utils
"""
Example extending the format: creating a new Interface.
This example uses two extensions defined in director "extensions"
e-interface.py - defines Interface extension
e-timeseries.py - defines a new timeseries type (My... | en | 0.661074 | #!/usr/bin/python Example extending the format: creating a new Interface. This example uses two extensions defined in director "extensions" e-interface.py - defines Interface extension e-timeseries.py - defines a new timeseries type (MyNewTimeSeries) The convention of having "e-" in front of the extension (and... | 2.403157 | 2 |
backend/parser/parser_listener.py | anglebinbin/Barista-tool | 1 | 6631184 |
class ParserListener:
def update(self, phase, row):
""" Called when the parser has parsed a new record.
"""
pass
def handle(self, event, message, groups):
""" Called when the parser has parsed a registered event.
"""
pass
def registerKey(self, phase, key)... |
class ParserListener:
def update(self, phase, row):
""" Called when the parser has parsed a new record.
"""
pass
def handle(self, event, message, groups):
""" Called when the parser has parsed a registered event.
"""
pass
def registerKey(self, phase, key)... | en | 0.932925 | Called when the parser has parsed a new record. Called when the parser has parsed a registered event. Called when a new key was found in the log data. Called when the parser has processed all available streams. | 2.407749 | 2 |
utils/logger.py | sungyihsun/meta-transfer-learning | 250 | 6631185 | <reponame>sungyihsun/meta-transfer-learning<filename>utils/logger.py
import os, sys
import logging
class Logger(object):
def __init__(self, log_name):
self.terminal = sys.stdout
if not os.path.exists(os.path.dirname(log_name)):
os.makedirs(os.path.dirname(log_name))
self.log =... | import os, sys
import logging
class Logger(object):
def __init__(self, log_name):
self.terminal = sys.stdout
if not os.path.exists(os.path.dirname(log_name)):
os.makedirs(os.path.dirname(log_name))
self.log = open(log_name, "w")
def write(self, message):
self.term... | en | 0.922697 | #this flush method is needed for python 3 compatibility. #this handles the flush command by doing nothing. #you might want to specify some extra behavior here. | 3.170983 | 3 |
data/train/python/db857ba8f6183651782147c38c1d8b7685958619roles.py | harshp8l/deep-learning-lang-detection | 84 | 6631186 | class ACObject(object): # Access Control Object
def __init__(self, name):
self.name = name
self.label = name.replace('_', ' ').capitalize()
self.description = self.label + ' ' + self.__class__.__name__.capitalize()
def __str__(self):
return "<%s: %s>" % (self.__class__.__name__, ... | class ACObject(object): # Access Control Object
def __init__(self, name):
self.name = name
self.label = name.replace('_', ' ').capitalize()
self.description = self.label + ' ' + self.__class__.__name__.capitalize()
def __str__(self):
return "<%s: %s>" % (self.__class__.__name__, ... | en | 0.809133 | # Access Control Object #access_own_info, #TODO : Add additional roles like accountant, event manager when they are # defined above | 2.700788 | 3 |
shop/views/completeorder.py | odrolliv13/Hex-Photos | 0 | 6631187 | from django import forms
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.db.models import Q
from manager import models as pmod
from . import templater
import decimal, datetime
from django.core.mail import send_mail
import requests
from base_app i... | from django import forms
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.db.models import Q
from manager import models as pmod
from . import templater
import decimal, datetime
from django.core.mail import send_mail
import requests
from base_app i... | en | 0.818201 | # This checks the options for the order. If not the page goes back to checkout and will display the errors # This gets the taxrate for the customer's state # Here the payment is checked # The journal entry is created here | 2.137847 | 2 |
unidad5/c_extensions/setup.py | leliel12/diseno_sci_sfw | 23 | 6631188 | <reponame>leliel12/diseno_sci_sfw
from distutils.core import setup, Extension
def main():
setup(name="fputs",
version="1.0.0",
description="Python interface for the fputs C library function",
author="<your name>",
author_email="<EMAIL>",
ext_modules=[Extension("fpu... | from distutils.core import setup, Extension
def main():
setup(name="fputs",
version="1.0.0",
description="Python interface for the fputs C library function",
author="<your name>",
author_email="<EMAIL>",
ext_modules=[Extension("fputs", ["fputsmodule.c"])])
if __na... | none | 1 | 1.410617 | 1 | |
resolwe_bio/tests/processes/test_reads_filtering.py | HudoGriz/resolwe-bio | 0 | 6631189 | # pylint: disable=missing-docstring
from resolwe.flow.models import Data
from resolwe.test import tag_process
from resolwe_bio.utils.test import BioProcessTestCase
class ReadsFilteringProcessorTestCase(BioProcessTestCase):
@tag_process('trimmomatic-single')
def test_trimmomatic_single(self):
with sel... | # pylint: disable=missing-docstring
from resolwe.flow.models import Data
from resolwe.test import tag_process
from resolwe_bio.utils.test import BioProcessTestCase
class ReadsFilteringProcessorTestCase(BioProcessTestCase):
@tag_process('trimmomatic-single')
def test_trimmomatic_single(self):
with sel... | en | 0.885042 | # pylint: disable=missing-docstring # Non-deterministic output. # Non-deterministic output. # Non-deterministic output. # Non-deterministic output. # Non-deterministic output. # Non-deterministic output. # Test if bamclipper has been skipped. # Test bamclipper. # Test if skipped. Input bam should always equal output ba... | 1.971467 | 2 |
tests/nightly/tools/benchmarking/test_benchmarking.py | alexriedel1/anomalib | 689 | 6631190 | <filename>tests/nightly/tools/benchmarking/test_benchmarking.py
"""Test benchmarking script on a subset of models and categories."""
# Copyright (C) 2022 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 ob... | <filename>tests/nightly/tools/benchmarking/test_benchmarking.py
"""Test benchmarking script on a subset of models and categories."""
# Copyright (C) 2022 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 ob... | en | 0.809317 | Test benchmarking script on a subset of models and categories. # Copyright (C) 2022 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.org/licenses/LICENS... | 2.183144 | 2 |
cortstim/base/utils/data_structures_utils.py | ncsl/virtual_cortical_stim_epilepsy | 1 | 6631191 | # Data structure manipulations and conversions
import re
import numpy as np
import json
from collections import OrderedDict
from copy import deepcopy
from cortstim.base.utils.log_error import raise_value_error, raise_import_error, initialize_logger
from datetime import date, datetime
logger = initialize_logger(__name... | # Data structure manipulations and conversions
import re
import numpy as np
import json
from collections import OrderedDict
from copy import deepcopy
from cortstim.base.utils.log_error import raise_value_error, raise_import_error, initialize_logger
from datetime import date, datetime
logger = initialize_logger(__name... | en | 0.692384 | # Data structure manipulations and conversions Special json encoder for numpy types # This is the fix A formal string representation for an object. :param attr_dict: dictionary attribute_name: attribute_value :param instance: Instance to read class name from it :param obj: Python object to introspect :retu... | 2.573698 | 3 |
aula2.py | Vitoraugustoliveira/python-tutorial | 0 | 6631192 | # Lists
list1 = []
print(type(list1))
lista = [1, 2, 3, 4]
lista2 = [5, 6, 7, 8]
matrix = [lista, lista2]
print(matrix)
print(matrix[0][1])
soma_lista = lista + lista2
print(soma_lista)
lista.append(85)
print(lista)
print(lista[-5])
print(lista[0])
lista.append("XABLAU")
print(lista)
lista.append(lista2)
print(l... | # Lists
list1 = []
print(type(list1))
lista = [1, 2, 3, 4]
lista2 = [5, 6, 7, 8]
matrix = [lista, lista2]
print(matrix)
print(matrix[0][1])
soma_lista = lista + lista2
print(soma_lista)
lista.append(85)
print(lista)
print(lista[-5])
print(lista[0])
lista.append("XABLAU")
print(lista)
lista.append(lista2)
print(l... | en | 0.480117 | # Lists #lista = [1, 2, 3, 4] # pos - -> value # 0 - -> 1 # 1 - -> 2 # 2 - -> 3 # 3 - -> 4 # -1 - -> 4 # -2 - -> 3 # -3 - -> 2 # -4 - -> 1 # Dict # Tuples # Sets | 3.833946 | 4 |
tests/common/test_case.py | tjaffri/paraphrase-id-tensorflow | 354 | 6631193 | # pylint: disable=invalid-name,protected-access
from unittest import TestCase
import codecs
import logging
import os
import shutil
import tensorflow as tf
class DuplicateTestCase(TestCase):
TEST_DIR = './TMP_TEST/'
TRAIN_FILE = TEST_DIR + 'train_file'
VALIDATION_FILE = TEST_DIR + 'validation_file'
TES... | # pylint: disable=invalid-name,protected-access
from unittest import TestCase
import codecs
import logging
import os
import shutil
import tensorflow as tf
class DuplicateTestCase(TestCase):
TEST_DIR = './TMP_TEST/'
TRAIN_FILE = TEST_DIR + 'train_file'
VALIDATION_FILE = TEST_DIR + 'validation_file'
TES... | en | 0.261104 | # pylint: disable=invalid-name,protected-access | 2.669614 | 3 |
convert to gray/convertToGray.py | Jerry0424/NDHU_ImageProcessing | 0 | 6631194 |
'''
Transform a color image into gray image using the conversion formula.
Show the pictures using matplotlib.
'''
# use matplotlib to help get the image and show the images
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# get the color image
img = mpimg.imread('lena.png')
# put the color image int... |
'''
Transform a color image into gray image using the conversion formula.
Show the pictures using matplotlib.
'''
# use matplotlib to help get the image and show the images
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# get the color image
img = mpimg.imread('lena.png')
# put the color image int... | en | 0.782724 | Transform a color image into gray image using the conversion formula. Show the pictures using matplotlib. # use matplotlib to help get the image and show the images # get the color image # put the color image into a subplot # Convert the color image into grayscale using the formula which adjusts the values of RGB # put... | 4.134772 | 4 |
moncli/column_value/base.py | harryrobbins/moncli | 40 | 6631195 | import json, copy
from schematics.transforms import blacklist
from schematics.types import StringType
from .. import entities as en, ColumnValueError
from .constants import SIMPLE_NULL_VALUE, COMPLEX_NULL_VALUE
class _ColumnValue(en.BaseColumn):
"""Base column value model"""
def __init__(self, **kwargs):
... | import json, copy
from schematics.transforms import blacklist
from schematics.types import StringType
from .. import entities as en, ColumnValueError
from .constants import SIMPLE_NULL_VALUE, COMPLEX_NULL_VALUE
class _ColumnValue(en.BaseColumn):
"""Base column value model"""
def __init__(self, **kwargs):
... | en | 0.3477 | Base column value model The value of an items column. Properties additional_info : `json` The column value's additional information. id : `str` The column's unique identifier. text : `str` The column's textual value in string form. title : `str` ... | 2.318736 | 2 |
flask_filer/api.py | BbsonLin/flask-filer | 1 | 6631196 | <reponame>BbsonLin/flask-filer<gh_stars>1-10
import os
import logging
from flask import json, jsonify, request, send_file, current_app
from flask.views import MethodView
from werkzeug.utils import secure_filename
from .utils import get_dirlist, get_info, open_file
from .exceptions import InvalidPathError
LOG = loggi... | import os
import logging
from flask import json, jsonify, request, send_file, current_app
from flask.views import MethodView
from werkzeug.utils import secure_filename
from .utils import get_dirlist, get_info, open_file
from .exceptions import InvalidPathError
LOG = logging.getLogger(__name__)
LOG.setLevel(logging.D... | none | 1 | 2.232646 | 2 | |
src/lgr/migrations/0001_initial.py | b4ckspace/lgr | 0 | 6631197 | # Generated by Django 3.0 on 2019-12-07 21:36
from django.db import migrations, models
import django.db.models.deletion
import lgr.mixin
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Barcode",
fields... | # Generated by Django 3.0 on 2019-12-07 21:36
from django.db import migrations, models
import django.db.models.deletion
import lgr.mixin
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Barcode",
fields... | en | 0.872726 | # Generated by Django 3.0 on 2019-12-07 21:36 | 1.714183 | 2 |
robotics_project/scripts/demo/manipulation_client.py | hect1995/Robotics_intro | 0 | 6631198 | <filename>robotics_project/scripts/demo/manipulation_client.py
#!/usr/bin/env python
# Copyright (c) 2016 PAL Robotics SL. All Rights Reserved
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and thi... | <filename>robotics_project/scripts/demo/manipulation_client.py
#!/usr/bin/env python
# Copyright (c) 2016 PAL Robotics SL. All Rights Reserved
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and thi... | en | 0.629898 | #!/usr/bin/env python # Copyright (c) 2016 PAL Robotics SL. All Rights Reserved # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the # above copyright notice and this permission notice appear in all # copies. # # THE SOFTWARE IS ... | 1.916987 | 2 |
real_trade/api/coincheck/__init__.py | taka-mochi/cryptocurrency-autotrading | 3 | 6631199 | <reponame>taka-mochi/cryptocurrency-autotrading
import os
import sys
#sys.path.append(os.path.dirname(__file__))
| import os
import sys
#sys.path.append(os.path.dirname(__file__)) | fa | 0.221498 | #sys.path.append(os.path.dirname(__file__)) | 1.622069 | 2 |
flappy-remake.py | dd2r/FlappyBirdDemo | 0 | 6631200 | import pygame
from pygame.locals import *
import random
#Initialize pygame
pygame.init()
clock = pygame.time.Clock()
fps = 60
#Screen constants
SCREEN_WIDTH = 864
SCREEN_HEIGHT = 936
#Screen size and window caption
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('Flappy Bi... | import pygame
from pygame.locals import *
import random
#Initialize pygame
pygame.init()
clock = pygame.time.Clock()
fps = 60
#Screen constants
SCREEN_WIDTH = 864
SCREEN_HEIGHT = 936
#Screen size and window caption
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('Flappy Bi... | en | 0.851633 | #Initialize pygame #Screen constants #Screen size and window caption #Define game variables #Load images and store them in variables #Sprite or character creation #Iterate through flappy bird images #rectangle to hold sprite for collision detection #location/coordinates for sprite on screen #Handle the animation #Creat... | 3.596909 | 4 |
day14-disk-fragmentation/run.py | mg6/advent-of-code-2017 | 0 | 6631201 | #!/usr/bin/env python3
from collections import deque
from functools import reduce
def hash_states(size=256):
state = deque(range(size))
skip_size = 0
at = 0
while True:
rev_length = yield
if rev_length > 1:
state.rotate(-at)
for v in [state.popleft() for _ i... | #!/usr/bin/env python3
from collections import deque
from functools import reduce
def hash_states(size=256):
state = deque(range(size))
skip_size = 0
at = 0
while True:
rev_length = yield
if rev_length > 1:
state.rotate(-at)
for v in [state.popleft() for _ i... | fr | 0.180376 | #!/usr/bin/env python3 0 00 00 01 23 0 1 11 11 111 101 111 010 111 010 101 101 101 101 010 101 | 2.69041 | 3 |
reports/api/urls.py | qgeindreau/Reddit | 54 | 6631202 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from django.conf.urls import url
from .views import ReportListCreateAPIView
urlpatterns = [
url(r'^reports/$', ReportListCreateAPIView.as_view(), name='list_or_create_reports'),
]
| #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from django.conf.urls import url
from .views import ReportListCreateAPIView
urlpatterns = [
url(r'^reports/$', ReportListCreateAPIView.as_view(), name='list_or_create_reports'),
]
| en | 0.308914 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- | 1.50139 | 2 |
data/studio21_generated/introductory/2896/starter_code.py | vijaykumawat256/Prompt-Summarization | 0 | 6631203 | def cost_of_carpet(room_length, room_width, roll_width, roll_cost):
| def cost_of_carpet(room_length, room_width, roll_width, roll_cost):
| none | 1 | 1.457503 | 1 | |
PythonScripts/PythonBootcamp/Operators/arithmetic.py | SleepWalKer09/PythonProjects | 0 | 6631204 | #arithmetic operators
# 1 + -> suma
# 2 - -> resta
# 3 * -> multiplicacion
# 4 / -> division
# 5 % -> modulo, regresa el remanente de la division
# 6 ** -> exponente
# 7 // -> division sin decimales
a = 5 ** 2
print(a) | #arithmetic operators
# 1 + -> suma
# 2 - -> resta
# 3 * -> multiplicacion
# 4 / -> division
# 5 % -> modulo, regresa el remanente de la division
# 6 ** -> exponente
# 7 // -> division sin decimales
a = 5 ** 2
print(a) | en | 0.188941 | #arithmetic operators # 1 + -> suma # 2 - -> resta # 3 * -> multiplicacion # 4 / -> division # 5 % -> modulo, regresa el remanente de la division # 6 ** -> exponente # 7 // -> division sin decimales | 3.940677 | 4 |
flips.py | framoni/whataretheodds | 0 | 6631205 | """
Karen flips N fair coins. Becky flips N+1 fair coins.
What's the probability for Becky to get more heads than Karen?
Compute it for an arbitary large N.
"""
from itertools import permutations
import numpy as np
import pandas as pd
import seaborn as sns
def probs_head(N):
base_prob = (1/2)**N
P = []
... | """
Karen flips N fair coins. Becky flips N+1 fair coins.
What's the probability for Becky to get more heads than Karen?
Compute it for an arbitary large N.
"""
from itertools import permutations
import numpy as np
import pandas as pd
import seaborn as sns
def probs_head(N):
base_prob = (1/2)**N
P = []
... | en | 0.879542 | Karen flips N fair coins. Becky flips N+1 fair coins. What's the probability for Becky to get more heads than Karen? Compute it for an arbitary large N. | 2.942378 | 3 |
heat/engine/resources/openstack/heat/wait_condition.py | stackriot/heat | 265 | 6631206 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | en | 0.893835 | # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ... | 1.93168 | 2 |
qiime2/plugin/plugin.py | longhdo/qiime2 | 0 | 6631207 | <reponame>longhdo/qiime2<filename>qiime2/plugin/plugin.py<gh_stars>0
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2019, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed w... | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2019, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | en | 0.811562 | # ---------------------------------------------------------------------------- # Copyright (c) 2016-2019, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------... | 1.778435 | 2 |
burlap/locale.py | tutordelphia/burlap | 0 | 6631208 | from __future__ import print_function
import re
from burlap import Satchel
from burlap.constants import *
from burlap.decorators import task
# Note, using the name "locale" doesn't allow the satchel to be imported due to a conflict with an existing variable/module.
class LocalesSatchel(Satchel):
name = 'locale... | from __future__ import print_function
import re
from burlap import Satchel
from burlap.constants import *
from burlap.decorators import task
# Note, using the name "locale" doesn't allow the satchel to be imported due to a conflict with an existing variable/module.
class LocalesSatchel(Satchel):
name = 'locale... | en | 0.868554 | # Note, using the name "locale" doesn't allow the satchel to be imported due to a conflict with an existing variable/module. # 'en_US.UTF-8' # 'en_US.UTF-8' # 'C' # 'en_US.UTF-8' Reads /etc/default/locale and returns a dictionary representing its key pairs. # Format NAME="value". # Locales is an odd case, because it ne... | 2.449201 | 2 |
models/zebra_motionworks.py | tervay/the-blue-alliance | 1 | 6631209 | <reponame>tervay/the-blue-alliance<gh_stars>1-10
import datetime
from google.appengine.ext import ndb
from models.event import Event
class ZebraMotionWorks(ndb.Model):
"""
The ZebraMotionWorks model represents robot tracking data from the
Zebra MotionWorks system
"""
event = ndb.KeyProperty(kind=E... | import datetime
from google.appengine.ext import ndb
from models.event import Event
class ZebraMotionWorks(ndb.Model):
"""
The ZebraMotionWorks model represents robot tracking data from the
Zebra MotionWorks system
"""
event = ndb.KeyProperty(kind=Event, required=True)
data = ndb.JsonProperty(... | en | 0.749953 | The ZebraMotionWorks model represents robot tracking data from the Zebra MotionWorks system | 2.841345 | 3 |
nrf_extract_edits/bs_pickup.py | siddacious/SA-45 | 7 | 6631210 | #!/usr/bin/env python2
# to run: python2 pickup.py
#
# OpenOCD library: https://github.com/screwer/OpenOCD
# change line 193
# if not self.Name:
#
# Use the OpenOCD library
from OpenOCD import OpenOCD
import sys
def int_to_bytes(value, length):
result = []
for i in range(0, length):
result.append(valu... | #!/usr/bin/env python2
# to run: python2 pickup.py
#
# OpenOCD library: https://github.com/screwer/OpenOCD
# change line 193
# if not self.Name:
#
# Use the OpenOCD library
from OpenOCD import OpenOCD
import sys
def int_to_bytes(value, length):
result = []
for i in range(0, length):
result.append(valu... | en | 0.723528 | #!/usr/bin/env python2 # to run: python2 pickup.py # # OpenOCD library: https://github.com/screwer/OpenOCD # change line 193 # if not self.Name: # # Use the OpenOCD library # create connection to running instance of OpenOCD # reset and halt the processor # create a variable for the program counter register # the addres... | 2.960784 | 3 |
tests/helpers/__init__.py | krypton-unite/time_series_generator | 4 | 6631211 | from .json_reader import get_json_from_file, get_data_from_file, write_data_to_file | from .json_reader import get_json_from_file, get_data_from_file, write_data_to_file | none | 1 | 1.459998 | 1 | |
relish/views/__init__.py | mbs-dev/django-relish | 1 | 6631212 | <filename>relish/views/__init__.py
from .messages import SuccessMessageMixin
| <filename>relish/views/__init__.py
from .messages import SuccessMessageMixin
| none | 1 | 1.070977 | 1 | |
crawler_api/crawlers/base.py | GabrielRocha/tj_crawler | 1 | 6631213 | import asyncio
from abc import ABC, abstractmethod
from parsel import Selector
class BaseCrawler(ABC):
paths = {}
def __init__(self, session):
self.session = session
async def execute(self, **kwargs):
task = [self._start_request(_id, url, **kwargs) for _id, url in self.paths.items()]
... | import asyncio
from abc import ABC, abstractmethod
from parsel import Selector
class BaseCrawler(ABC):
paths = {}
def __init__(self, session):
self.session = session
async def execute(self, **kwargs):
task = [self._start_request(_id, url, **kwargs) for _id, url in self.paths.items()]
... | none | 1 | 2.836848 | 3 | |
tpm2_pytss/util/swig.py | pdxjohnny/tpm2-pytss | 0 | 6631214 | import os
import inspect
import logging
from functools import partial, wraps
from typing import Any
logging.basicConfig(
level=getattr(logging, os.environ.get("TPM2_PYTSS_LOG_LEVEL", "CRITICAL").upper())
)
LOGGER = logging.getLogger(__name__)
class PointerAlreadyInUse(Exception):
pass # pragma: no cov
cla... | import os
import inspect
import logging
from functools import partial, wraps
from typing import Any
logging.basicConfig(
level=getattr(logging, os.environ.get("TPM2_PYTSS_LOG_LEVEL", "CRITICAL").upper())
)
LOGGER = logging.getLogger(__name__)
class PointerAlreadyInUse(Exception):
pass # pragma: no cov
cla... | en | 0.896289 | # pragma: no cov By forcing context management we ensure users of the bindings are explicit about their usage and freeing of allocated resources. Rather than relying on the garbage collector. This makes it harder for them to leave assets lying around. Creates a class of the requested pointer functions data ... | 2.372627 | 2 |
python/testData/codeInsight/smartEnter/argumentsFirst.py | truthiswill/intellij-community | 2 | 6631215 | <gh_stars>1-10
def foo(*a):
pass
foo<caret>(1, 2, 3 | def foo(*a):
pass
foo<caret>(1, 2, 3 | none | 1 | 1.280604 | 1 | |
data/data_loader.py | Fodark/PerceptualSimilarity | 2,245 | 6631216 | def CreateDataLoader(datafolder,dataroot='./dataset',dataset_mode='2afc',load_size=64,batch_size=1,serial_batches=True,nThreads=4):
from data.custom_dataset_data_loader import CustomDatasetDataLoader
data_loader = CustomDatasetDataLoader()
# print(data_loader.name())
data_loader.initialize(datafolder,da... | def CreateDataLoader(datafolder,dataroot='./dataset',dataset_mode='2afc',load_size=64,batch_size=1,serial_batches=True,nThreads=4):
from data.custom_dataset_data_loader import CustomDatasetDataLoader
data_loader = CustomDatasetDataLoader()
# print(data_loader.name())
data_loader.initialize(datafolder,da... | en | 0.079477 | # print(data_loader.name()) | 2.38237 | 2 |
losses/get_loss.py | zdaiot/NAIC-Person-Re-identification | 0 | 6631217 | <reponame>zdaiot/NAIC-Person-Re-identification<filename>losses/get_loss.py<gh_stars>0
import torch
import torch.nn as nn
from losses.triplet_loss import TripletLoss, CrossEntropyLabelSmooth, TripletLossOrigin
class Loss(nn.Module):
def __init__(self, model_name, loss_name, margin, num_classes):
"""
... | import torch
import torch.nn as nn
from losses.triplet_loss import TripletLoss, CrossEntropyLabelSmooth, TripletLossOrigin
class Loss(nn.Module):
def __init__(self, model_name, loss_name, margin, num_classes):
"""
:param model_name: 模型的名称;类型为str
:param loss_name: 损失的名称;类型为str
:par... | zh | 0.752311 | :param model_name: 模型的名称;类型为str :param loss_name: 损失的名称;类型为str :param margin: TripletLoss中的参数;类型为float :param num_classes: 网络的参数 # 如果有多个损失函数,在加上一个求和操作 # self.log的维度为[1, len(self.loss)],前面几个分别存放某次迭代各个损失函数的损失值,最后一个存放某次迭代损失值之和 :param outputs: 网络的输出,具体维度和网络有关 :param labels: 数据的真实类标,具体维度和网络有关... | 2.411145 | 2 |
data-science-essentials-in-python/numpy-gradient.py | zzragida/study-datascience | 0 | 6631218 | import numpy as np
def main():
f = np.array([1, 2, 4, 7, 11, 16], dtype=float)
print(np.gradient(f))
print(np.gradient(f, 2))
if __name__ == "__main__":
main() | import numpy as np
def main():
f = np.array([1, 2, 4, 7, 11, 16], dtype=float)
print(np.gradient(f))
print(np.gradient(f, 2))
if __name__ == "__main__":
main() | none | 1 | 3.431188 | 3 | |
tests/child_chain/test_child_chain_integration.py | kevjue/plasma-mvp | 1 | 6631219 | <filename>tests/child_chain/test_child_chain_integration.py
from web3 import Web3
from plasma.child_chain.transaction import Transaction
NULL_ADDRESS = b'\x00' * 20
NULL_ADDRESS_HEX = '0x' + NULL_ADDRESS.hex()
def test_deposit(test_lang):
owner_1 = test_lang.get_account()
deposit_id = test_lang.deposit(own... | <filename>tests/child_chain/test_child_chain_integration.py
from web3 import Web3
from plasma.child_chain.transaction import Transaction
NULL_ADDRESS = b'\x00' * 20
NULL_ADDRESS_HEX = '0x' + NULL_ADDRESS.hex()
def test_deposit(test_lang):
owner_1 = test_lang.get_account()
deposit_id = test_lang.deposit(own... | none | 1 | 1.895343 | 2 | |
muxmon.py | bertwesarg/openssh-mux-mon | 0 | 6631220 | <gh_stars>0
#!/usr/bin/env python2
import os
import os.path
import stat
import sys
import subprocess
import pygtk
pygtk.require('2.0')
import gtk
import gobject
import gconf
import pynotify
import pyinotify
import appindicator
import SshMuxClient
GCONF_APP = '/apps/sshmuxmon'
GCONF_APP_PATH = os.path.join(GCONF_APP... | #!/usr/bin/env python2
import os
import os.path
import stat
import sys
import subprocess
import pygtk
pygtk.require('2.0')
import gtk
import gobject
import gconf
import pynotify
import pyinotify
import appindicator
import SshMuxClient
GCONF_APP = '/apps/sshmuxmon'
GCONF_APP_PATH = os.path.join(GCONF_APP, 'path')
GC... | en | 0.375719 | #!/usr/bin/env python2 # create a menu # there are not the same, cleanup previous root, if any # clear previous known mux #print >>sys.stderr, ' could not get info from %s: %s' % (path, name,) #print >>sys.stderr, 'Already existing mux: %s' % (name,) #item.set_sensitive(False) #print 'exit indicator' # populate devices... | 2.148119 | 2 |
algorithms_in_python/_4_recursion/examples/disk_usage.py | junteudjio/algorithms_in_python | 0 | 6631221 | <gh_stars>0
import os
__author__ = '<NAME>'
def disk_usage(path):
total = os.path.getsize(path)
if os.path.isdir(path):
children = [ os.path.join(path, child) for child in os.listdir(path)]
for child_path in children:
total += disk_usage(child_path)
return total
if __name__ =... | import os
__author__ = '<NAME>'
def disk_usage(path):
total = os.path.getsize(path)
if os.path.isdir(path):
children = [ os.path.join(path, child) for child in os.listdir(path)]
for child_path in children:
total += disk_usage(child_path)
return total
if __name__ == '__main__'... | none | 1 | 2.936397 | 3 | |
webtool/server/serializers/frontend/tours.py | wodo/WebTool3 | 13 | 6631222 | <reponame>wodo/WebTool3<gh_stars>10-100
from rest_framework import serializers
from rest_framework.reverse import reverse
from django.core.mail import send_mail
from server.models import (
Tour, Guide, Category, Equipment, State, get_default_state, get_default_season, Event,
Skill, Fitness, Topic)
from server.... | from rest_framework import serializers
from rest_framework.reverse import reverse
from django.core.mail import send_mail
from server.models import (
Tour, Guide, Category, Equipment, State, get_default_state, get_default_season, Event,
Skill, Fitness, Topic)
from server.serializers.frontend.core import EventSe... | en | 0.69037 | # ? # # ? # # ? # # Administrative Felder fehlen noch ! # This is the Update case # Set Youth-On-Tour if tour is especially for youth # Format team-members # Format equipments | 2.081945 | 2 |
deck_of_many_things.py | Mego/Tymora | 0 | 6631223 | <gh_stars>0
#!/usr/bin/env python3
import random
import atexit
import pickle
decks = {}
def save_decks():
with open("decks.pickle", 'wb') as f:
pickle.dump(decks, f)
print("Decks saved")
def load_decks():
global decks
try:
with open("decks.pickle", 'rb') as f:
... | #!/usr/bin/env python3
import random
import atexit
import pickle
decks = {}
def save_decks():
with open("decks.pickle", 'wb') as f:
pickle.dump(decks, f)
print("Decks saved")
def load_decks():
global decks
try:
with open("decks.pickle", 'rb') as f:
de... | en | 0.312863 | #!/usr/bin/env python3 Sun
Moon
Star
Throne
Key
Knight
Void
Flames
Skull
Ruin
Euryale
Rogue
Jester Vizier
Comet
Fates
Gem
Talons
Idiot
Donjon
Balance
Fool # 75% chance of 13-card deck | 3.259289 | 3 |
tests/test_geometry/test_area.py | carterbox/xdesign | 18 | 6631224 | <filename>tests/test_geometry/test_area.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2016, UChicago Argonne, LLC. All rights reserved. #
# #
# ... | <filename>tests/test_geometry/test_area.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2016, UChicago Argonne, LLC. All rights reserved. #
# #
# ... | en | 0.779149 | #!/usr/bin/env python # -*- coding: utf-8 -*- # ######################################################################### # Copyright (c) 2016, UChicago Argonne, LLC. All rights reserved. # # # # Copyright 2015. UChicago Argonne, LLC. This ... | 1.296742 | 1 |
tests/test_integration.py | pandadefi/ape-solidity | 0 | 6631225 | <reponame>pandadefi/ape-solidity
from pathlib import Path
TEST_CONTRACTS = [str(p.stem) for p in (Path(__file__).parent / "contracts").iterdir()]
def test_integration(project):
for contract in TEST_CONTRACTS:
assert contract in project.contracts
contract = project.contracts[contract]
asse... | from pathlib import Path
TEST_CONTRACTS = [str(p.stem) for p in (Path(__file__).parent / "contracts").iterdir()]
def test_integration(project):
for contract in TEST_CONTRACTS:
assert contract in project.contracts
contract = project.contracts[contract]
assert contract.source_id == f"{contr... | none | 1 | 2.208782 | 2 | |
GearBot/Util/Utils.py | AEnterprise/GearBot | 20 | 6631226 | import asyncio
import json
import os
import subprocess
from collections import namedtuple, OrderedDict
from datetime import datetime
from json import JSONDecodeError
from subprocess import Popen
import discord
import math
from discord import NotFound
from Util import GearbotLogging, Translator, Emoji
from Util.Matche... | import asyncio
import json
import os
import subprocess
from collections import namedtuple, OrderedDict
from datetime import datetime
from json import JSONDecodeError
from subprocess import Popen
import discord
import math
from discord import NotFound
from Util import GearbotLogging, Translator, Emoji
from Util.Matche... | en | 0.774726 | # resolve user mentions # resolve role mentions # resolve channel names #{uid}>", name) # re-assemble emoji so such a way that they don't turn into twermoji #find urls last so the < escaping doesn't break it #{user.discriminator}" # It existed in the Redis cache, check length cause sometimes somehow things are missing,... | 2.236742 | 2 |
main.py | ICRC-BME/NoiseDetectionCNN | 1 | 6631227 | from noise_detector import noise_detector, mef3_channel_iterator
from timer import timer
import pymef
def example_0():
"""
Predict probabilities for categories: noise,pathology and physiology based on given 3s long data segment (15000 samples)
"""
# initialize detector instance
detector = noise_d... | from noise_detector import noise_detector, mef3_channel_iterator
from timer import timer
import pymef
def example_0():
"""
Predict probabilities for categories: noise,pathology and physiology based on given 3s long data segment (15000 samples)
"""
# initialize detector instance
detector = noise_d... | en | 0.741839 | Predict probabilities for categories: noise,pathology and physiology based on given 3s long data segment (15000 samples) # initialize detector instance # load mef3 file # predict probabilities for given data segment Predict probabilities for categories: noise,pathology and physiology for given channel Predict singl... | 2.345066 | 2 |
pexception/__init__.py | rchui/pexception | 1 | 6631228 | <reponame>rchui/pexception<filename>pexception/__init__.py
from .pexception import hook # noqa: disable
| from .pexception import hook # noqa: disable | en | 0.363427 | # noqa: disable | 1.089404 | 1 |
gym_puyopuyo/gym_puyopuyo/__init__.py | brnor/dipl | 12 | 6631229 | <reponame>brnor/dipl
from gym_puyopuyo.env import register # noqa: F401
| from gym_puyopuyo.env import register # noqa: F401 | uz | 0.465103 | # noqa: F401 | 1.039246 | 1 |
GCN/wsd_sent_embeddings.py | AakashSrinivasan03/GlossBert-GraphEmbeddings | 0 | 6631230 | <gh_stars>0
# coding=utf-8
"""BERT finetuning runner."""
from __future__ import absolute_import, division, print_function
import argparse
from collections import OrderedDict
import csv
import logging
import os
import random
import sys
import pandas as pd
import numpy as np
import torch
import torch.nn.functional as... | # coding=utf-8
"""BERT finetuning runner."""
from __future__ import absolute_import, division, print_function
import argparse
from collections import OrderedDict
import csv
import logging
import os
import random
import sys
import pandas as pd
import numpy as np
import torch
import torch.nn.functional as F
from torc... | en | 0.809242 | # coding=utf-8 BERT finetuning runner. Look up a synset given the information from SemCor ### Assuming it is the same WN version (e.g. 3.0) A single training/test example for simple sequence classification. Constructs a InputExample. Args: guid: Unique id for the example. text_a: string... | 2.331173 | 2 |
cli/backend_cloud_formation.py | cprecup/pnda-cli | 3 | 6631231 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Cisco and/or its affiliates.
# This software is licensed to you under the terms of the Apache License, Version 2.0
# (the "License").
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# The c... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Cisco and/or its affiliates.
# This software is licensed to you under the terms of the Apache License, Version 2.0
# (the "License").
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# The code, technical ... | en | 0.866943 | #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Cisco and/or its affiliates. # This software is licensed to you under the terms of the Apache License, Version 2.0 # (the "License"). # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # The code, technical ... | 1.897178 | 2 |
Apps/Recommendations/Python/checkColdRecomFeatureMatch.py | jfindlay/Azure-MachineLearning-DataScience | 390 | 6631232 | #
# In this script we check the returned scoring items when the seed item is cold
# In terms of checking, we check if there is any features with the same value.
# In this version, only one seed item is supported.
# list of input files:
# 1. catalog file
# 2. trainining file
# 3. seed file
# 4. the scoring file usin... | #
# In this script we check the returned scoring items when the seed item is cold
# In terms of checking, we check if there is any features with the same value.
# In this version, only one seed item is supported.
# list of input files:
# 1. catalog file
# 2. trainining file
# 3. seed file
# 4. the scoring file usin... | en | 0.829907 | # # In this script we check the returned scoring items when the seed item is cold # In terms of checking, we check if there is any features with the same value. # In this version, only one seed item is supported. # list of input files: # 1. catalog file # 2. trainining file # 3. seed file # 4. the scoring file using co... | 2.611547 | 3 |
shopyo/api/tests/conftest.py | ChaseKnowlden/shopyo | 235 | 6631233 | """
file: api/tests/conftest.py
All pytest fixtures local only to the api/tests are placed here
"""
import pytest
import os
import shutil
import tempfile
@pytest.fixture
def cleandir():
old_cwd = os.getcwd()
newpath = tempfile.mkdtemp()
os.chdir(newpath)
yield
os.chdir(old_cwd)
shutil.rmtree(n... | """
file: api/tests/conftest.py
All pytest fixtures local only to the api/tests are placed here
"""
import pytest
import os
import shutil
import tempfile
@pytest.fixture
def cleandir():
old_cwd = os.getcwd()
newpath = tempfile.mkdtemp()
os.chdir(newpath)
yield
os.chdir(old_cwd)
shutil.rmtree(n... | en | 0.61302 | file: api/tests/conftest.py All pytest fixtures local only to the api/tests are placed here creates a fake shopyo like directory structure as shown below foo/ foo/ modules/ bar/ static/ bar.css baz/ ... | 2.48114 | 2 |
ch01-arrays-and-strings/q09-string-rotation.py | AdityaSinghShekhawat/ctci-python | 0 | 6631234 | #! /usr/bin/python
"""
String Rotation:Assumeyou have a method isSubstring which checks if one word is a substring of another. Given two strings, sl and s2, write code to check if s2 is a rotation of sl using only one call to isSubstring (e.g.,"waterbottle" is a rotation of"erbottlewat").
"""
def string_rotation(s1: s... | #! /usr/bin/python
"""
String Rotation:Assumeyou have a method isSubstring which checks if one word is a substring of another. Given two strings, sl and s2, write code to check if s2 is a rotation of sl using only one call to isSubstring (e.g.,"waterbottle" is a rotation of"erbottlewat").
"""
def string_rotation(s1: s... | en | 0.831731 | #! /usr/bin/python String Rotation:Assumeyou have a method isSubstring which checks if one word is a substring of another. Given two strings, sl and s2, write code to check if s2 is a rotation of sl using only one call to isSubstring (e.g.,"waterbottle" is a rotation of"erbottlewat"). # We have to use is_substring # In... | 4.330295 | 4 |
ionical/ionical.py | danyul/ionical | 4 | 6631235 | <filename>ionical/ionical.py
"""Multipurpose ics util - changelogs, CSVs, schedule viewing."""
import csv
import re
import sys
import urllib.request
from collections import OrderedDict, defaultdict
from datetime import date, datetime, time, timedelta # , tzinfo
from pathlib import Path
from typing import DefaultDict, ... | <filename>ionical/ionical.py
"""Multipurpose ics util - changelogs, CSVs, schedule viewing."""
import csv
import re
import sys
import urllib.request
from collections import OrderedDict, defaultdict
from datetime import date, datetime, time, timedelta # , tzinfo
from pathlib import Path
from typing import DefaultDict, ... | en | 0.78227 | Multipurpose ics util - changelogs, CSVs, schedule viewing. # , tzinfo # type: ignore # type: ignore Cal (or entity) with a schedule specified via .ics format. # TODO: for performance, probably no need to get a whole new # ScheduleHistory (Can instead just add the newly downloaded # schedule to existing sch... | 2.520388 | 3 |
mvlearn/compose/merge.py | idc9/mvlearn | 0 | 6631236 | """Merging utilities."""
# Copyright 2019 NeuroData (http://neurodata.io)
#
# 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 require... | """Merging utilities."""
# Copyright 2019 NeuroData (http://neurodata.io)
#
# 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 require... | en | 0.715219 | Merging utilities. # Copyright 2019 NeuroData (http://neurodata.io) # # 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... | 2.485856 | 2 |
xeasy_ml/xes_ml_arch/src/ml/prediction_ml.py | jiayanduo456/xeasy-ml | 10 | 6631237 | # -*-coding:utf-8-*-
# @version: 0.0.1
# License: MIT
from . import base_ml
import traceback
from ..ml_utils import runstatus
class PredictionML(base_ml.BaseML):
"""
This basic class encapsulates the functions of the prediction part, and you can call the method
of the class to make predictions on the tes... | # -*-coding:utf-8-*-
# @version: 0.0.1
# License: MIT
from . import base_ml
import traceback
from ..ml_utils import runstatus
class PredictionML(base_ml.BaseML):
"""
This basic class encapsulates the functions of the prediction part, and you can call the method
of the class to make predictions on the tes... | en | 0.494464 | # -*-coding:utf-8-*- # @version: 0.0.1 # License: MIT This basic class encapsulates the functions of the prediction part, and you can call the method of the class to make predictions on the test set. Parameters -------- conf : configparser.ConfigParser, default = None Configuration file for pre... | 3.025934 | 3 |
comspy/user/Server_Chinese.py | SunnyLi1106/Comspy | 1 | 6631238 | <gh_stars>1-10
#!/usr/bin/python3
# 文件名:server.py
# 导入 socket、sys 模块
import socket
import sys
import threading
def server(Maximum_Number_Connections):
# 创建 socket 对象
serversocket = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
# 获取本地主机名
host = socket.gethostname()
... | #!/usr/bin/python3
# 文件名:server.py
# 导入 socket、sys 模块
import socket
import sys
import threading
def server(Maximum_Number_Connections):
# 创建 socket 对象
serversocket = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
# 获取本地主机名
host = socket.gethostname()
port = in... | zh | 0.88468 | #!/usr/bin/python3 # 文件名:server.py # 导入 socket、sys 模块 # 创建 socket 对象 # 获取本地主机名 # 绑定端口号 # 设置最大连接数,超过后排队 # 建立客户端连接 | 3.408534 | 3 |
examples/temp.seq.py | carbonscott/pyrotein | 1 | 6631239 | <filename>examples/temp.seq.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
## import sys
## sys.path.insert(0, '/home/scott/Dropbox/codes/pyrotein')
import pyrotein as pr
import os
fl_aln = 'seq.align.fasta'
seq_dict = pr.fasta.read(fl_aln)
tally_dict = pr.fasta.tally_resn_in_seqs(seq_dict)
super_seq = pr.fasta.... | <filename>examples/temp.seq.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
## import sys
## sys.path.insert(0, '/home/scott/Dropbox/codes/pyrotein')
import pyrotein as pr
import os
fl_aln = 'seq.align.fasta'
seq_dict = pr.fasta.read(fl_aln)
tally_dict = pr.fasta.tally_resn_in_seqs(seq_dict)
super_seq = pr.fasta.... | en | 0.420313 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- ## import sys ## sys.path.insert(0, '/home/scott/Dropbox/codes/pyrotein') # Read coordinates from a PDB file... # Create a lookup table for this pdb... | 2.22007 | 2 |
napari_allencell_segmenter/_tests/core/state_test.py | neuromusic/napari-allencell-segmenter | 8 | 6631240 | import pytest
from unittest import mock
from unittest.mock import MagicMock, create_autospec
from napari_allencell_segmenter.core.state import State, SegmenterModel
class TestRouter:
def setup_method(self):
self._state = State()
def test_segmenter_model(self):
# Assert
assert self._s... | import pytest
from unittest import mock
from unittest.mock import MagicMock, create_autospec
from napari_allencell_segmenter.core.state import State, SegmenterModel
class TestRouter:
def setup_method(self):
self._state = State()
def test_segmenter_model(self):
# Assert
assert self._s... | none | 1 | 2.396544 | 2 | |
seqlib/interval.py | kepbod/seqlib | 2 | 6631241 | <filename>seqlib/interval.py
'''
interval.py - Deal with intervals.
author: <NAME> <<EMAIL>>
version: 1.0
'''
# copied and modified from https://github.com/kepbod/interval
import sys
import copy
class Interval(object):
'''
Class: Interval
Maintainer: <NAME>
Version: 1.0
Usage: a = Interval(li... | <filename>seqlib/interval.py
'''
interval.py - Deal with intervals.
author: <NAME> <<EMAIL>>
version: 1.0
'''
# copied and modified from https://github.com/kepbod/interval
import sys
import copy
class Interval(object):
'''
Class: Interval
Maintainer: <NAME>
Version: 1.0
Usage: a = Interval(li... | en | 0.679238 | interval.py - Deal with intervals. author: <NAME> <<EMAIL>> version: 1.0 # copied and modified from https://github.com/kepbod/interval Class: Interval Maintainer: <NAME> Version: 1.0 Usage: a = Interval(list) (nested list: [[x,x,f1...],[x,x,f2...]...] / [[x,x],[x,x]...] or simple l... | 3.555102 | 4 |
addon/models.py | flavours/registry-proof-of-concept | 0 | 6631242 | <filename>addon/models.py<gh_stars>0
from addon.fields import NonStrippingTextField
from core.models import UUIDPrimaryKeyMixin
from django.contrib.postgres.fields import JSONField
from django.db import models
from markupfield.fields import MarkupField
from rest_framework.reverse import reverse
class Stack(UUIDPrimar... | <filename>addon/models.py<gh_stars>0
from addon.fields import NonStrippingTextField
from core.models import UUIDPrimaryKeyMixin
from django.contrib.postgres.fields import JSONField
from django.db import models
from markupfield.fields import MarkupField
from rest_framework.reverse import reverse
class Stack(UUIDPrimar... | none | 1 | 2.299134 | 2 | |
Mundo 1 Fundamentos/ex014.py | costa53/curso_em_video_python3 | 1 | 6631243 | <reponame>costa53/curso_em_video_python3
# DESAFIO 014
# Escreva um programa que converta uma temperatura digitada em °C e a converta para °F.
c = float(input('Informe a temperatura em °C: '))
f = (c * 1.8) + 32
print(f'A temperatura de {c}°C corresponde a {f:.1f}°F!')
| # DESAFIO 014
# Escreva um programa que converta uma temperatura digitada em °C e a converta para °F.
c = float(input('Informe a temperatura em °C: '))
f = (c * 1.8) + 32
print(f'A temperatura de {c}°C corresponde a {f:.1f}°F!') | pt | 0.960902 | # DESAFIO 014 # Escreva um programa que converta uma temperatura digitada em °C e a converta para °F. | 4.31714 | 4 |
t3f/ops_test.py | towadroid/t3f | 217 | 6631244 | import numpy as np
import tensorflow as tf
tf.compat.v1.enable_eager_execution()
from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
from t3f import ops
from t3f import shapes
from t3f import initializers
class _TTTensorTest():
def testFullTensor2d(self):
np.random.see... | import numpy as np
import tensorflow as tf
tf.compat.v1.enable_eager_execution()
from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
from t3f import ops
from t3f import shapes
from t3f import initializers
class _TTTensorTest():
def testFullTensor2d(self):
np.random.see... | en | 0.899411 | # Basically do full by hand. # Inner product between two TT-tensors. # Inner product between a TT-tensor and a sparse tensor. # Sum two TT-tensors. # Multiply two TT-tensors. # Multiply a tensor by a number. # Frobenius norm of a TT-tensor. # Test cast function for float tt-tensors. # Tests cast function from int to fl... | 2.277857 | 2 |
tetravolume.py | 4dsolutions/Python5 | 11 | 6631245 | <filename>tetravolume.py
"""
Euler volume, modified by <NAME>
http://www.grunch.net/synergetics/quadvols.html
<NAME> (c) MIT License
The tetravolume.py methods make_tet and make_tri
assume that volume and area use R-edge cubes and
triangles for XYZ units respectively, and D-edge
tetrahedrons and triangles for IVM u... | <filename>tetravolume.py
"""
Euler volume, modified by <NAME>
http://www.grunch.net/synergetics/quadvols.html
<NAME> (c) MIT License
The tetravolume.py methods make_tet and make_tri
assume that volume and area use R-edge cubes and
triangles for XYZ units respectively, and D-edge
tetrahedrons and triangles for IVM u... | en | 0.867617 | Euler volume, modified by <NAME> http://www.grunch.net/synergetics/quadvols.html <NAME> (c) MIT License The tetravolume.py methods make_tet and make_tri assume that volume and area use R-edge cubes and triangles for XYZ units respectively, and D-edge tetrahedrons and triangles for IVM units of volume and area (D =... | 3.600841 | 4 |
Implementations/software/python/ROMULUS_M_AEAD.py | rweather/romulus | 0 | 6631246 |
# ROMULUS-M Python Implementation
# Copyright 2020:
# <NAME> <<EMAIL>>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any ... |
# ROMULUS-M Python Implementation
# Copyright 2020:
# <NAME> <<EMAIL>>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any ... | en | 0.707593 | # ROMULUS-M Python Implementation # Copyright 2020: # <NAME> <<EMAIL>> # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later versio... | 2.562165 | 3 |
generated/intermediate/ansible-module-sdk/azure_rm_batchapplicationpackage.py | audevbot/autorest.devops.debug | 0 | 6631247 | <gh_stars>0
#!/usr/bin/python
#
# Copyright (c) 2019 <NAME>, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | #!/usr/bin/python
#
# Copyright (c) 2019 <NAME>, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | en | 0.730986 | #!/usr/bin/python # # Copyright (c) 2019 <NAME>, (@zikalino) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ---
module: azure_rm_batchapplicationpackage version_added: '2.9' short_description: Manage Azure ApplicationPackage instance. description: - 'Create, update and... | 1.826823 | 2 |
tofu/tests/tests06_mesh/test_01_checks.py | WinstonLHS/tofu | 56 | 6631248 | """
This module contains tests for tofu.geom in its structured version
"""
# Built-in
import os
import shutil
import itertools as itt
import warnings
# Standard
import numpy as np
import matplotlib.pyplot as plt
# tofu-specific
from tofu import __version__
import tofu as tf
import tofu.data as tfd
_HERE = os.pat... | """
This module contains tests for tofu.geom in its structured version
"""
# Built-in
import os
import shutil
import itertools as itt
import warnings
# Standard
import numpy as np
import matplotlib.pyplot as plt
# tofu-specific
from tofu import __version__
import tofu as tf
import tofu.data as tfd
_HERE = os.pat... | en | 0.318734 | This module contains tests for tofu.geom in its structured version # Built-in # Standard # tofu-specific ####################################################### # # Setup and Teardown # ####################################################### # Recreating clean .tofu # out = subprocess.run(_CUSTOM, stdout=PIPE, stde... | 2.285281 | 2 |
cscs-checks/tools/profiling_and_debugging/scorep_mpi_omp.py | jfavre/reframe | 0 | 6631249 | <reponame>jfavre/reframe<filename>cscs-checks/tools/profiling_and_debugging/scorep_mpi_omp.py
import os
import reframe as rfm
import reframe.utility.sanity as sn
@rfm.required_version('>=2.14')
@rfm.parameterized_test(['C++'], ['F90'])
class ScorepHybrid(rfm.RegressionTest):
def __init__(self, lang):
sup... | import os
import reframe as rfm
import reframe.utility.sanity as sn
@rfm.required_version('>=2.14')
@rfm.parameterized_test(['C++'], ['F90'])
class ScorepHybrid(rfm.RegressionTest):
def __init__(self, lang):
super().__init__()
self.name = 'scorep_mpi_omp_%s' % lang.replace('+', 'p')
self.... | en | 0.831788 | # NOTE: Restrict concurrency to allow creation of Fortran modules # additional program call in order to generate the tracing output for # the sanity check | 2.004617 | 2 |
nvchecker/source/packagist.py | bboerst/nvchecker | 0 | 6631250 | <reponame>bboerst/nvchecker
# MIT licensed
# Copyright (c) 2013-2017 lilydjwg <<EMAIL>>, et al.
from .simple_json import simple_json
PACKAGIST_URL = 'https://packagist.org/packages/%s.json'
def _version_from_json(data):
data = {version: details for version, details in data["package"]['versions'].items() if version... | # MIT licensed
# Copyright (c) 2013-2017 lilydjwg <<EMAIL>>, et al.
from .simple_json import simple_json
PACKAGIST_URL = 'https://packagist.org/packages/%s.json'
def _version_from_json(data):
data = {version: details for version, details in data["package"]['versions'].items() if version != "dev-master"}
if len(... | en | 0.50344 | # MIT licensed # Copyright (c) 2013-2017 lilydjwg <<EMAIL>>, et al. | 2.185652 | 2 |