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 |
|---|---|---|---|---|---|---|---|---|---|---|
project_management/urls.py | wambozaAllan/Sybyl-Service-Desk-Web | 1 | 6625751 | <filename>project_management/urls.py
from django.urls import path, re_path
from . import views
# app_name = 'project_management'
urlpatterns = [
path('projects/', views.load_all_projects, name='full_project_list'),
path('ongoing/', views.ProjectListView.as_view(), name='project_list'),
path('ajax/load_sele... | <filename>project_management/urls.py
from django.urls import path, re_path
from . import views
# app_name = 'project_management'
urlpatterns = [
path('projects/', views.load_all_projects, name='full_project_list'),
path('ongoing/', views.ProjectListView.as_view(), name='project_list'),
path('ajax/load_sele... | en | 0.462898 | # app_name = 'project_management' # re_path(r'^tasks-project/(?P<project_id>\d+)/$', views.task_list_by_project, name='project_task_list'), # path('listProjects/', views.ListProjects.as_view(), name='listProjects'), # TIMESHEETS # Schedules plans # REPORTS # Project code # CUSTOMER URLS | 2.001275 | 2 |
detection/scrfd/mmdet/models/detectors/base.py | qaz734913414/insightface | 12,377 | 6625752 | from abc import ABCMeta, abstractmethod
from collections import OrderedDict
import mmcv
import numpy as np
import torch
import torch.distributed as dist
import torch.nn as nn
from mmcv.runner import auto_fp16
from mmcv.utils import print_log
from mmdet.utils import get_root_logger
class BaseDetector(nn.Module, meta... | from abc import ABCMeta, abstractmethod
from collections import OrderedDict
import mmcv
import numpy as np
import torch
import torch.distributed as dist
import torch.nn as nn
from mmcv.runner import auto_fp16
from mmcv.utils import print_log
from mmdet.utils import get_root_logger
class BaseDetector(nn.Module, meta... | en | 0.787981 | Base class for detectors. bool: whether the detector has a neck # TODO: these properties need to be carefully handled # for both single stage & two stage detectors bool: whether the detector has a shared head in the RoI Head bool: whether the detector has a bbox head bool: whether the detector has a mask head Extract f... | 2.115427 | 2 |
platform/gsutil/gslib/commands/cors.py | bopopescu/SDK | 0 | 6625753 | # -*- coding: utf-8 -*-
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | # -*- coding: utf-8 -*-
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | en | 0.734944 | # -*- coding: utf-8 -*- # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require... | 1.77858 | 2 |
azure-mgmt-botservice/azure/mgmt/botservice/models/azure_bot_service_enums.py | Christina-Kang/azure-sdk-for-python | 1 | 6625754 | <filename>azure-mgmt-botservice/azure/mgmt/botservice/models/azure_bot_service_enums.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# lice... | <filename>azure-mgmt-botservice/azure/mgmt/botservice/models/azure_bot_service_enums.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# lice... | en | 0.583126 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ... | 1.813247 | 2 |
example2.py | elplatt/repsci | 2 | 6625755 | <gh_stars>1-10
# Import the logging library
import repsci
# Create a config
import configparser
config = configparser.ConfigParser()
config['DEFAULT'] = {
'message': 'Hello, World!'
}
# Create an experiment
exp_name = "hello_config"
exp = repsci.Experiment(exp_name, config=config)
# Get the logger and write a lo... | # Import the logging library
import repsci
# Create a config
import configparser
config = configparser.ConfigParser()
config['DEFAULT'] = {
'message': 'Hello, World!'
}
# Create an experiment
exp_name = "hello_config"
exp = repsci.Experiment(exp_name, config=config)
# Get the logger and write a log message
log =... | en | 0.591657 | # Import the logging library # Create a config # Create an experiment # Get the logger and write a log message # Create an output file in the unique output directory | 2.829704 | 3 |
bioconda_utils/docker_utils.py | grst/bioconda-utils | 0 | 6625756 | #!/usr/bin/env python
"""
To ensure conda packages are built in the most compatible manner, we can use
a docker container. This module supports using a docker container to build
conda packages in the local channel which can later be uploaded to anaconda.
Note that we cannot simply bind the host's conda-bld directory... | #!/usr/bin/env python
"""
To ensure conda packages are built in the most compatible manner, we can use
a docker container. This module supports using a docker container to build
conda packages in the local channel which can later be uploaded to anaconda.
Note that we cannot simply bind the host's conda-bld directory... | en | 0.77908 | #!/usr/bin/env python To ensure conda packages are built in the most compatible manner, we can use a docker container. This module supports using a docker container to build conda packages in the local channel which can later be uploaded to anaconda. Note that we cannot simply bind the host's conda-bld directory to t... | 2.419465 | 2 |
examples/schedulers/sync.py | sasirajpuvvada/apscheduler | 4,294 | 6625757 | <gh_stars>1000+
import logging
from apscheduler.schedulers.sync import Scheduler
from apscheduler.triggers.interval import IntervalTrigger
from apscheduler.workers.sync import Worker
def say_hello():
print('Hello!')
logging.basicConfig(level=logging.DEBUG)
try:
with Scheduler() as scheduler, Worker(schedul... | import logging
from apscheduler.schedulers.sync import Scheduler
from apscheduler.triggers.interval import IntervalTrigger
from apscheduler.workers.sync import Worker
def say_hello():
print('Hello!')
logging.basicConfig(level=logging.DEBUG)
try:
with Scheduler() as scheduler, Worker(scheduler.data_store, p... | none | 1 | 2.335916 | 2 | |
adblocker.py | iam-shanmukha/adlocker | 3 | 6625758 | <filename>adblocker.py
#!/usr/bin/python
import os,sys, platform
import datetime
hosts = ["https://adaway.org/hosts.txt",
"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"]
WINDOWS_ETC = "c:\\Windows\\System32\\Drivers\\etc\\"
WINDOWS_HOSTS = "c:\\Windows\\System32\\Drivers\\etc\\hosts"
count = 1
pr... | <filename>adblocker.py
#!/usr/bin/python
import os,sys, platform
import datetime
hosts = ["https://adaway.org/hosts.txt",
"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"]
WINDOWS_ETC = "c:\\Windows\\System32\\Drivers\\etc\\"
WINDOWS_HOSTS = "c:\\Windows\\System32\\Drivers\\etc\\hosts"
count = 1
pr... | en | 0.310139 | #!/usr/bin/python _ _ _ _ __ _ __| | |__ | | ___ ___| | _____ _ __ _ __ _ _ / _` |/ _` | '_ \| |/ _ \ / __| |/ / _ \ '__| | '_ \| | | | | (_| | (_| | |_) | | (_) | (__| < __/ | _ | |_) | |_| | \__,_|\__,_|_.__/|_|\___/ \___|_|\_\___|_| (_) | ... | 2.382369 | 2 |
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_infra_dumper_cfg.py | tkamata-test/ydk-py | 0 | 6625759 | <filename>cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_infra_dumper_cfg.py
""" Cisco_IOS_XR_infra_dumper_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR infra\-dumper package configuration.
This module contains definitions
for the following management objects\:
exception\: Core dum... | <filename>cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_infra_dumper_cfg.py
""" Cisco_IOS_XR_infra_dumper_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR infra\-dumper package configuration.
This module contains definitions
for the following management objects\:
exception\: Core dum... | en | 0.405607 | Cisco_IOS_XR_infra_dumper_cfg This module contains a collection of YANG definitions for Cisco IOS\-XR infra\-dumper package configuration. This module contains definitions for the following management objects\: exception\: Core dump configuration commands Copyright (c) 2013\-2016 by Cisco Systems, Inc. All rights... | 1.858802 | 2 |
signalProcessing/backscatter_expt_040716.py | macoskey/backscatter | 0 | 6625760 | # <NAME>, U of Michigan, I-GUTL, April 2017
# backscatter analysis of signals from 250 kHz 256-element array
# Objective: observe bubble cloud migration on high-speed camera and compare to
# ACE peak arrival (and edge detection) signal.
import numpy as np
import scipi.io as sio
import matplotlib.pyplot as plt
class a... | # <NAME>, U of Michigan, I-GUTL, April 2017
# backscatter analysis of signals from 250 kHz 256-element array
# Objective: observe bubble cloud migration on high-speed camera and compare to
# ACE peak arrival (and edge detection) signal.
import numpy as np
import scipi.io as sio
import matplotlib.pyplot as plt
class a... | en | 0.837807 | # <NAME>, U of Michigan, I-GUTL, April 2017 # backscatter analysis of signals from 250 kHz 256-element array # Objective: observe bubble cloud migration on high-speed camera and compare to # ACE peak arrival (and edge detection) signal. | 2.350068 | 2 |
SNCKPE19/BUDDYNIM.py | Chhekur/codechef-solutions | 1 | 6625761 | <gh_stars>1-10
for _ in range(int(input())):
n,m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
e,f = [],[]
c,d = 0,0
n1,n2 = 0,0
for i in a:
if(i > 0):
e.append(i)
c += 1
if(i == 1):n1 += 1
for i in b:
if(i > 0):
f.append(i)
d +... | for _ in range(int(input())):
n,m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
e,f = [],[]
c,d = 0,0
n1,n2 = 0,0
for i in a:
if(i > 0):
e.append(i)
c += 1
if(i == 1):n1 += 1
for i in b:
if(i > 0):
f.append(i)
d += 1
if(i == 1... | none | 1 | 2.880741 | 3 | |
setup.py | ZYunH/Convert-Into-Command | 5 | 6625762 | #!/usr/bin/env python
import os
import sys
from setuptools import setup, find_packages
# 'setup.py publish' shortcut.
if sys.argv[-1] == 'publish':
os.system('pip3 install twine')
os.system('pip3 install wheel')
os.system('python3 setup.py sdist bdist_wheel')
os.system('twine upload dist/*')
os.sys... | #!/usr/bin/env python
import os
import sys
from setuptools import setup, find_packages
# 'setup.py publish' shortcut.
if sys.argv[-1] == 'publish':
os.system('pip3 install twine')
os.system('pip3 install wheel')
os.system('python3 setup.py sdist bdist_wheel')
os.system('twine upload dist/*')
os.sys... | en | 0.151061 | #!/usr/bin/env python # 'setup.py publish' shortcut. | 2.17891 | 2 |
model.py | lmm6895071/leo | 0 | 6625763 | # Copyright 2018 DeepMind Technologies Limited
#
# 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 agr... | # Copyright 2018 DeepMind Technologies Limited
#
# 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 agr... | en | 0.818106 | # Copyright 2018 DeepMind Technologies Limited # # 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 agr... | 2.056504 | 2 |
tests/integrationv2/test_well_known_endpoints.py | glaubitz/s2n | 0 | 6625764 | <reponame>glaubitz/s2n
import copy
import os
import pytest
from constants import TRUST_STORE_BUNDLE
from configuration import available_ports, PROTOCOLS
from common import ProviderOptions, Protocols, Ciphers
from fixtures import managed_process
from global_flags import get_flag, S2N_NO_PQ, S2N_FIPS_MODE
from providers... | import copy
import os
import pytest
from constants import TRUST_STORE_BUNDLE
from configuration import available_ports, PROTOCOLS
from common import ProviderOptions, Protocols, Ciphers
from fixtures import managed_process
from global_flags import get_flag, S2N_NO_PQ, S2N_FIPS_MODE
from providers import Provider, S2N
f... | en | 0.987002 | # If PQ was compiled into S2N, test the PQ preferences against KMS | 1.840452 | 2 |
examples/gurobipy/metrorail/metrorail.py | adampkehoe/ticdat | 0 | 6625765 | <gh_stars>0
#
# Models Tallys Yunes Metrorail tickets problem.
# https://orbythebeach.wordpress.com/2018/03/01/buying-metrorail-tickets-in-miami/
# https://www.linkedin.com/pulse/miami-metrorail-meets-python-peter-cacioppi/
#
# Implement core functionality needed to achieve modularity.
# 1. Define the input data schema... | #
# Models Tallys Yunes Metrorail tickets problem.
# https://orbythebeach.wordpress.com/2018/03/01/buying-metrorail-tickets-in-miami/
# https://www.linkedin.com/pulse/miami-metrorail-meets-python-peter-cacioppi/
#
# Implement core functionality needed to achieve modularity.
# 1. Define the input data schema
# 2. Define... | en | 0.551666 | # # Models Tallys Yunes Metrorail tickets problem. # https://orbythebeach.wordpress.com/2018/03/01/buying-metrorail-tickets-in-miami/ # https://www.linkedin.com/pulse/miami-metrorail-meets-python-peter-cacioppi/ # # Implement core functionality needed to achieve modularity. # 1. Define the input data schema # 2. Define... | 2.710314 | 3 |
genetic-tuner/lib/listtools.py | windstrip/Genetic-Algorithm-PID-Controller-Tuner | 39 | 6625766 | <reponame>windstrip/Genetic-Algorithm-PID-Controller-Tuner
# Reference:
# http://code.activestate.com/recipes/278258/
def sumList(L):
return reduce(lambda x,y:x+y, L)
def avgList(L):
return reduce(lambda x,y:x+y, L) /(len(L)*1.0)
def normList(L, normalizeTo=1):
'''normalize values of a list to make its m... | # Reference:
# http://code.activestate.com/recipes/278258/
def sumList(L):
return reduce(lambda x,y:x+y, L)
def avgList(L):
return reduce(lambda x,y:x+y, L) /(len(L)*1.0)
def normList(L, normalizeTo=1):
'''normalize values of a list to make its max = normalizeTo'''
vMax = max(L)
return [ x/(vMax... | en | 0.466604 | # Reference: # http://code.activestate.com/recipes/278258/ normalize values of a list to make its max = normalizeTo normalize values of a list to make it sum = sumTo L= [1, 2, 3, 4, 5]: accumList(L)=> [1, 3, 6, 10, 15] L= [0.25, 0.25, 0.25, 0.25]: accumList(L)=> [0.25, 0.50, 0.75, 1.00] normali... | 3.32148 | 3 |
appspotify/pytify/core/album.py | DiegoSantosWS/spotfy-py | 0 | 6625767 | <reponame>DiegoSantosWS/spotfy-py<filename>appspotify/pytify/core/album.py
from .parameter import prepare_params
from .request import execute_request
def get_album_tracks(album_id, auth, params=None):
if album_id is None or album_id is '':
raise AttributeError(
'Parameter `album_id` c... | from .parameter import prepare_params
from .request import execute_request
def get_album_tracks(album_id, auth, params=None):
if album_id is None or album_id is '':
raise AttributeError(
'Parameter `album_id` cannot be `None` or empty.')
url_template = '{base_url}/{area}/{album... | none | 1 | 2.423047 | 2 | |
collection/clientlib/base.py | WilkinsonK/python-collections | 0 | 6625768 | <reponame>WilkinsonK/python-collections<filename>collection/clientlib/base.py
import functools
from abc import ABC, abstractmethod
from clientlib.enums import Method
from clientlib.errors import HTTPError
from clientlib.mixins import ClientInitMixIn, ClientValidationMixIn
from clientlib.typedefs import Response, Sess... | import functools
from abc import ABC, abstractmethod
from clientlib.enums import Method
from clientlib.errors import HTTPError
from clientlib.mixins import ClientInitMixIn, ClientValidationMixIn
from clientlib.typedefs import Response, Session
def not_implemented(method):
"""
Raise a not implemented error i... | en | 0.701957 | Raise a not implemented error if method returns 'NotImplemented' type. Not implemented here. Handle http protocol errors. Not implemented here. Send a health check ping to api reference. Not implemented here. Reset the client session. Not implemented here. Send a request using the Ap... | 2.349908 | 2 |
simulation_ws/src/ros2_robot_simulation/launch/launch.py | samuk/ANI717_Robotics | 0 | 6625769 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""ROS2 Robot Simulation Launch File.
This script simulates a robot in Gazebo simulation.
Revision History:
2021-10-23 (Animesh): Baseline Software.
Example:
$ colcon build && source install/setup.bash && ros2 launch ros2_robot_simulation launch.py
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""ROS2 Robot Simulation Launch File.
This script simulates a robot in Gazebo simulation.
Revision History:
2021-10-23 (Animesh): Baseline Software.
Example:
$ colcon build && source install/setup.bash && ros2 launch ros2_robot_simulation launch.py
... | en | 0.511068 | #!/usr/bin/env python # -*- coding: utf-8 -*- ROS2 Robot Simulation Launch File. This script simulates a robot in Gazebo simulation. Revision History: 2021-10-23 (Animesh): Baseline Software. Example: $ colcon build && source install/setup.bash && ros2 launch ros2_robot_simulation launch.py ... | 2.215135 | 2 |
zillowdb/packages/sfm/str_encoding.py | MacHu-GWU/zillowdb-project | 0 | 6625770 | <reponame>MacHu-GWU/zillowdb-project
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
def encode_base64_urlsafe(text):
"""Convert any utf-8 string to url safe string using base64 encoding.
**中文文档**
将任意utf-8字符串用base64编码算法编码为纯数字和字母。
"""
return base64.urlsafe_b64encode(text.encod... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
def encode_base64_urlsafe(text):
"""Convert any utf-8 string to url safe string using base64 encoding.
**中文文档**
将任意utf-8字符串用base64编码算法编码为纯数字和字母。
"""
return base64.urlsafe_b64encode(text.encode("utf-8")).decode("utf-8")
def dec... | zh | 0.478128 | #!/usr/bin/env python # -*- coding: utf-8 -*- Convert any utf-8 string to url safe string using base64 encoding. **中文文档** 将任意utf-8字符串用base64编码算法编码为纯数字和字母。 Reverse operation of :func:`encode_base64_urlsafe`. **中文文档** 将base64字符串解码为原字符串。 | 2.961841 | 3 |
unit_tests.py | ccubed/OTPy | 2 | 6625771 | import unittest
from otpy.hotp import hotp
from otpy.totp import totp
class TestHotp(unittest.TestCase):
def setUp(self):
self.expected = [755224, 287082, 359152, 969429, 338314, 254676, 287922, 162583, 399871, 520489]
self.instance = hotp("12345678901234567890", 0, 6)
def test_rfc4226(self):
... | import unittest
from otpy.hotp import hotp
from otpy.totp import totp
class TestHotp(unittest.TestCase):
def setUp(self):
self.expected = [755224, 287082, 359152, 969429, 338314, 254676, 287922, 162583, 399871, 520489]
self.instance = hotp("12345678901234567890", 0, 6)
def test_rfc4226(self):
... | none | 1 | 2.639287 | 3 | |
cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py | hashsos/hashcloudos-cinder | 0 | 6625772 | <filename>cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py<gh_stars>0
# (c) Copyright 2014 Cisco Systems 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 th... | <filename>cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py<gh_stars>0
# (c) Copyright 2014 Cisco Systems 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 th... | en | 0.859524 | # (c) Copyright 2014 Cisco Systems 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 # # Unl... | 1.942299 | 2 |
template/_base_typedef_pyi.py | Amourspirit/ooo_uno_tmpl | 0 | 6625773 | <gh_stars>0
# coding: utf-8
from _base_typedef import BaseTypeDef
from _base_json import EventArgs
class BaseTypeDefPyi(BaseTypeDef):
def on_after_init_data(self, args: EventArgs) -> None:
super().on_after_init_data(args=args)
| # coding: utf-8
from _base_typedef import BaseTypeDef
from _base_json import EventArgs
class BaseTypeDefPyi(BaseTypeDef):
def on_after_init_data(self, args: EventArgs) -> None:
super().on_after_init_data(args=args) | en | 0.833554 | # coding: utf-8 | 2.205923 | 2 |
icetray/resources/test/no_such_library.py | hschwane/offline_production | 1 | 6625774 | #!/usr/bin/env python
from I3Tray import *
tray = I3Tray()
try:
from icecube import no_such_library
tray.AddModule("BottomlessSource")
tray.AddModule("NoSuchModule")
tray.Execute(5)
except:
print("Good. It threw.")
sys.exit(0) # indicate success.
else:
print("should have thrown")
sy... | #!/usr/bin/env python
from I3Tray import *
tray = I3Tray()
try:
from icecube import no_such_library
tray.AddModule("BottomlessSource")
tray.AddModule("NoSuchModule")
tray.Execute(5)
except:
print("Good. It threw.")
sys.exit(0) # indicate success.
else:
print("should have thrown")
sy... | en | 0.378994 | #!/usr/bin/env python # indicate success. | 1.968271 | 2 |
data/wordstat.py | barzerman/barzer | 1 | 6625775 | <reponame>barzerman/barzer
#!/usr/bin/python
# -*- coding: utf-8 -*-
import fileinput,codecs, sys, re
#reads in the file in CLASS|SUBCLASS|ID|name format
#and produces statements
writer = codecs.getwriter('utf-8')(sys.stdout)
reader = codecs.getreader('utf-8')(sys.stdin)
utf8_re=re.compile(u'[^а-яА-Я]+',re.UNICODE... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import fileinput,codecs, sys, re
#reads in the file in CLASS|SUBCLASS|ID|name format
#and produces statements
writer = codecs.getwriter('utf-8')(sys.stdout)
reader = codecs.getreader('utf-8')(sys.stdin)
utf8_re=re.compile(u'[^а-яА-Я]+',re.UNICODE)
wordcnt={}
for line in r... | en | 0.625077 | #!/usr/bin/python # -*- coding: utf-8 -*- #reads in the file in CLASS|SUBCLASS|ID|name format #and produces statements #handling capitalized words - discovering proper names | 3.862461 | 4 |
setup.py | plaplant/SSINS | 4 | 6625776 | from __future__ import absolute_import, division, print_function
from setuptools import setup
import os
import sys
import json
sys.path.append('SSINS')
def package_files(package_dir, subdirectory):
# walk the input package_dir/subdirectory
# return a package_data list
paths = []
directory = os.path.... | from __future__ import absolute_import, division, print_function
from setuptools import setup
import os
import sys
import json
sys.path.append('SSINS')
def package_files(package_dir, subdirectory):
# walk the input package_dir/subdirectory
# return a package_data list
paths = []
directory = os.path.... | en | 0.343599 | # walk the input package_dir/subdirectory # return a package_data list | 1.949172 | 2 |
ansible/venv/lib/python2.7/site-packages/ansible/module_utils/service_now.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 17 | 6625777 | <filename>ansible/venv/lib/python2.7/site-packages/ansible/module_utils/service_now.py
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Ansible Project
# Copyright: (c) 2017, <NAME> <<EMAIL>>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import... | <filename>ansible/venv/lib/python2.7/site-packages/ansible/module_utils/service_now.py
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Ansible Project
# Copyright: (c) 2017, <NAME> <<EMAIL>>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import... | en | 0.680558 | # -*- coding: utf-8 -*- # Copyright: (c) 2019, Ansible Project # Copyright: (c) 2017, <NAME> <<EMAIL>> # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) # Pull in pysnow Constructor # No previous token exists, Generate new. | 2.025828 | 2 |
housekeeping/urls.py | aptivate/Arkestra | 1 | 6625778 | from django.conf.urls.defaults import *
from django.contrib import admin
urlpatterns = patterns('',
(r"^housekeeping/statistics/", "housekeeping.statistics.stats"),
# /housekeeping/repair_mptt/contacts_and_people.Entity/
(r"^housekeeping/repair_mptt/(?P<slug>[-\w\.]+)/$", "housekeeping.repair_mptt.fix"),
... | from django.conf.urls.defaults import *
from django.contrib import admin
urlpatterns = patterns('',
(r"^housekeeping/statistics/", "housekeeping.statistics.stats"),
# /housekeeping/repair_mptt/contacts_and_people.Entity/
(r"^housekeeping/repair_mptt/(?P<slug>[-\w\.]+)/$", "housekeeping.repair_mptt.fix"),
... | en | 0.706029 | # /housekeeping/repair_mptt/contacts_and_people.Entity/ # then, try to match /housekeeping/<task>/<execute> # # no match? # (r"^housekeeping/clean_plugins/", "housekeeping.clean_plugins.clean"), # # # (r"^statistics/user/(?P<slug>[-\w]+)$", "housekeeping.statistics.userstats"), | 1.864911 | 2 |
modules/plugin_social_auth/social/apps/cherrypy_app/models.py | KallyMilton/w2p-social-auth | 1 | 6625779 | """Flask SQLAlchemy ORM models for Social Auth"""
import cherrypy
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.schema import UniqueConstraint
from sqlalchemy.ext.declarative import declarative_base
from social.utils import setting_name, module_memb... | """Flask SQLAlchemy ORM models for Social Auth"""
import cherrypy
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.schema import UniqueConstraint
from sqlalchemy.ext.declarative import declarative_base
from social.utils import setting_name, module_memb... | en | 0.673991 | Flask SQLAlchemy ORM models for Social Auth Social Auth association model One use numbers OpenId account association # base64 encoded | 2.71294 | 3 |
src/sima/simo/liftlinecoupling.py | SINTEF/simapy | 0 | 6625780 | <filename>src/sima/simo/liftlinecoupling.py
# This an autogenerated file
#
# Generated with LiftLineCoupling
from __future__ import annotations
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.liftlinecoupling import LiftLineCouplingBlueprint
from... | <filename>src/sima/simo/liftlinecoupling.py
# This an autogenerated file
#
# Generated with LiftLineCoupling
from __future__ import annotations
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.liftlinecoupling import LiftLineCouplingBlueprint
from... | en | 0.417639 | # This an autogenerated file # # Generated with LiftLineCoupling Keyword arguments ----------------- name : str (default "") description : str (default "") _id : str (default "") scriptableValues : List[ScriptableValue] endPoint1 : SIMOBodyPoint endPoint2 : SIMOBod... | 2.182281 | 2 |
src/tests/ftest/erasurecode/ec_offline_rebuild.py | Junkrat-boommm/daos | 0 | 6625781 | #!/usr/bin/python
'''
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
from ec_utils import ErasureCodeIor
from apricot import skipForTicket
class EcOfflineRebuild(ErasureCodeIor):
# pylint: disable=too-many-ancestors
"""
Test Class Description: To validate E... | #!/usr/bin/python
'''
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
from ec_utils import ErasureCodeIor
from apricot import skipForTicket
class EcOfflineRebuild(ErasureCodeIor):
# pylint: disable=too-many-ancestors
"""
Test Class Description: To validate E... | en | 0.681471 | #!/usr/bin/python (C) Copyright 2020-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent # pylint: disable=too-many-ancestors Test Class Description: To validate Erasure code object data after killing single server (offline rebuild). :avocado: recursive Initialize a E... | 2.117483 | 2 |
pynab/helpers.py | idwagner/pynab | 0 | 6625782 | <filename>pynab/helpers.py<gh_stars>0
import re
import click
from pynab.client import YNABClient, get_credentials
from pynab import exceptions
RE_UUID = re.compile(r'^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$')
def get_client():
try:
credentials = get_credentials()
client = ... | <filename>pynab/helpers.py<gh_stars>0
import re
import click
from pynab.client import YNABClient, get_credentials
from pynab import exceptions
RE_UUID = re.compile(r'^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$')
def get_client():
try:
credentials = get_credentials()
client = ... | en | 0.968603 | Check if string is an UUID. # There were multiple matches | 2.578122 | 3 |
py/desigal/__init__.py | biprateep/DESI-stack | 1 | 6625783 | from .redshift import redshift
from .resample import resample
from .normalize import normalize
from .coadd_cameras import coadd_cameras
from .resample import resample
from .sky import get_sky
from .model_ivar import model_ivar
from .stack import stack_spectra | from .redshift import redshift
from .resample import resample
from .normalize import normalize
from .coadd_cameras import coadd_cameras
from .resample import resample
from .sky import get_sky
from .model_ivar import model_ivar
from .stack import stack_spectra | none | 1 | 1.054106 | 1 | |
misc/carbon-relay/web.py | Krylon360/evernote-graphite-web | 8 | 6625784 | #!/usr/bin/env python
"""Copyright 2008 Orbitz WorldWide
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 t... | #!/usr/bin/env python
"""Copyright 2008 Orbitz WorldWide
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 t... | en | 0.783037 | #!/usr/bin/env python Copyright 2008 Orbitz WorldWide 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 i... | 1.917176 | 2 |
src/pretalx/submission/models/review.py | mberube/pretalx | 0 | 6625785 | from django.db import models
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from django_scopes import ScopedManager
from i18nfield.fields import I18nCharField
from pretalx.common.urls import EventUrls
class ReviewScoreCategory(models.Model):
event = mod... | from django.db import models
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from django_scopes import ScopedManager
from i18nfield.fields import I18nCharField
from pretalx.common.urls import EventUrls
class ReviewScoreCategory(models.Model):
event = mod... | en | 0.817119 | Reviews model the opinion of reviewers of a. :class:`~pretalx.submission.models.submission.Submission`. They can, but don't have to, include a score and a text. :param text: The review itself. May be empty. :param score: This score is calculated from all the related ``scores`` and their weigh... | 1.950302 | 2 |
Martel/test/testformats/delimiter.py | eoc21/biopython | 3 | 6625786 | <reponame>eoc21/biopython<filename>Martel/test/testformats/delimiter.py
"""Example of using Martel on a simple delimited file
"""
import Martel
from Martel import RecordReader
def delimiter(delim):
assert len(delim) == 1, \
"delimiter can only be a single character long, not %s" % repr(delim)
asser... | """Example of using Martel on a simple delimited file
"""
import Martel
from Martel import RecordReader
def delimiter(delim):
assert len(delim) == 1, \
"delimiter can only be a single character long, not %s" % repr(delim)
assert delim not in "\n\r", "Cannot use %s as a delimiter" % repr(delim)
... | en | 0.710825 | Example of using Martel on a simple delimited file | 3.426341 | 3 |
wagtail_hooks.py | bobslee/django_commerce_wagtail | 3 | 6625787 | from django.contrib.admin.utils import quote
from django.templatetags.static import static
from django.urls import reverse
from django.utils.html import format_html, format_html_join
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailcore import hooks
from wagtail.wagtailadmin import widgets a... | from django.contrib.admin.utils import quote
from django.templatetags.static import static
from django.urls import reverse
from django.utils.html import format_html, format_html_join
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailcore import hooks
from wagtail.wagtailadmin import widgets a... | en | 0.349119 | # TODO if user has_permission for (django)admin product_change | 2.009243 | 2 |
Bugscan_exploits-master/exp_list/exp-2625.py | csadsl/poc_exp | 11 | 6625788 | <gh_stars>10-100
#!/usr/bin/evn python
#--coding:utf-8--*--
#Name:北京网达信联通用型电子采购系统多处SQL注入打包
#Refer:http://www.wooyun.org/bugs/wooyun-2010-0122276
#Author:xq17
def assign(service, arg):
if service == '1caitong':
return True, arg
def audit(arg):
urls = [
"Rat/ebid/viewInvite3.asp?InviteI... | #!/usr/bin/evn python
#--coding:utf-8--*--
#Name:北京网达信联通用型电子采购系统多处SQL注入打包
#Refer:http://www.wooyun.org/bugs/wooyun-2010-0122276
#Author:xq17
def assign(service, arg):
if service == '1caitong':
return True, arg
def audit(arg):
urls = [
"Rat/ebid/viewInvite3.asp?InviteId=0000002852",
... | en | 0.179071 | #!/usr/bin/evn python #--coding:utf-8--*-- #Name:北京网达信联通用型电子采购系统多处SQL注入打包 #Refer:http://www.wooyun.org/bugs/wooyun-2010-0122276 #Author:xq17 # audit(assign('1caitong','http://zhaobiao.cdjcc.com/')[1]) # audit(assign('1caitong','http://eps.myande.com/')[1]) # audit(assign('1caitong','http://caigou.irico.com.cn/')[1]) | 2.083378 | 2 |
update_readme.py | montib/rays1bench | 0 | 6625789 | import os
import glob
import shutil
import fileinput
def replace_text_in_file(file_to_search, text_to_search, results):
with fileinput.FileInput(file_to_search, inplace=True) as file:
for line in file:
print(line.replace(text_to_search, results), end='')
def parse(dirs, size, add_table_head... | import os
import glob
import shutil
import fileinput
def replace_text_in_file(file_to_search, text_to_search, results):
with fileinput.FileInput(file_to_search, inplace=True) as file:
for line in file:
print(line.replace(text_to_search, results), end='')
def parse(dirs, size, add_table_head... | en | 0.422473 | # print('parsing: ' + i + '/' + str(size)) # 123.45 mrays/s # 123.45 # last value is in bold # print('RESULTS = \n' + results + '\n') # all results # step1 # stepPREV -> stepCURRENT | 3.249587 | 3 |
azure_monitor/tests/auto_collection/test_metrics_span_processor.py | yao-cqc/opentelemetry-azure-monitor-python | 13 | 6625790 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import unittest
from opentelemetry.sdk.trace import Span
from opentelemetry.trace import SpanContext, SpanKind
from opentelemetry.trace.status import Status, StatusCanonicalCode
from azure_monitor.sdk.auto_collection.metric... | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import unittest
from opentelemetry.sdk.trace import Span
from opentelemetry.trace import SpanContext, SpanKind
from opentelemetry.trace.status import Status, StatusCanonicalCode
from azure_monitor.sdk.auto_collection.metric... | en | 0.720511 | # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # pylint: disable=protected-access Test the document collection. | 2.113647 | 2 |
votacoes/views.py | JeanSchnorr/votaluno | 0 | 6625791 | <filename>votacoes/views.py
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.contrib.auth.models import User
from .models import Aluno, AvaliacaoTurma, AvaliacaoAluno, Turma, OfertaDisciplina, Conselho,UsuarioConselho, Votacao, Voto
from django.shortcuts... | <filename>votacoes/views.py
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.contrib.auth.models import User
from .models import Aluno, AvaliacaoTurma, AvaliacaoAluno, Turma, OfertaDisciplina, Conselho,UsuarioConselho, Votacao, Voto
from django.shortcuts... | pt | 0.954273 | # Views que manipulam as avaliações das turmas #Views que manipulam as avaliações dos alunos #Views que manipulam a administração #Views para Conselhos # Gerar conselho #Criar e popular lista de professores que dão aula para essa turma # Gerar relacionamento UsuarioConselho # Gerar votacoes dos alunos da turma deste co... | 2.155288 | 2 |
clippercard/parser.py | timroesner/clippercard-python | 1 | 6625792 | """
Copyright (c) 2012-2017 (https://github.com/clippercard/clippercard-python)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use,... | """
Copyright (c) 2012-2017 (https://github.com/clippercard/clippercard-python)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use,... | en | 0.749832 | Copyright (c) 2012-2017 (https://github.com/clippercard/clippercard-python) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, cop... | 2.242225 | 2 |
examples/et312-info.py | nannook206/buttshock-py | 1 | 6625793 | #!/bin/python3
#
# Examples:
# python3 info.py -p /dev/ttyUSB0
#
import sys
import fcntl
import argparse
from time import sleep
sys.path.append("../")
import buttshock.et312
def main():
modes = {0x76:"Waves", 0x77:"Stroke", 0x78:"Climb", 0x79:"Combo", 0x7a:"Intense", 0x7b:"Rhythm",
0x7c:"Audio1... | #!/bin/python3
#
# Examples:
# python3 info.py -p /dev/ttyUSB0
#
import sys
import fcntl
import argparse
from time import sleep
sys.path.append("../")
import buttshock.et312
def main():
modes = {0x76:"Waves", 0x77:"Stroke", 0x78:"Climb", 0x79:"Combo", 0x7a:"Intense", 0x7b:"Rhythm",
0x7c:"Audio1... | en | 0.208008 | #!/bin/python3 # # Examples: # python3 info.py -p /dev/ttyUSB0 # # lazy default # Lock the serial port while we use it, wait a few seconds # no need to do a handshake unless we want to poke # print ("[+] trying handshake") # et312.perform_handshake() # print ("[+] handshake ok") #x}".format(et31... | 2.446251 | 2 |
blackjack_test.py | coolioasjulio/reinforcement-learning-playground | 0 | 6625794 | from keras.models import load_model
import gym
import numpy as np
model = load_model('models/dqn_Blackjack-v0-43.h5')
ENV_NAME = 'Blackjack-v0'
# Get the environment and extract the number of actions.
env = gym.make(ENV_NAME)
def debug(msg, enabled):
if enabled:
print(msg)
def play_game(debug_enabled... | from keras.models import load_model
import gym
import numpy as np
model = load_model('models/dqn_Blackjack-v0-43.h5')
ENV_NAME = 'Blackjack-v0'
# Get the environment and extract the number of actions.
env = gym.make(ENV_NAME)
def debug(msg, enabled):
if enabled:
print(msg)
def play_game(debug_enabled... | en | 0.877973 | # Get the environment and extract the number of actions. | 2.480184 | 2 |
tests/__init__.py | OpenEntityMap/oem-client | 0 | 6625795 | from __future__ import absolute_import, division, print_function
import logging
logging.basicConfig(level=logging.DEBUG)
| from __future__ import absolute_import, division, print_function
import logging
logging.basicConfig(level=logging.DEBUG)
| none | 1 | 1.214142 | 1 | |
examples/wrappers.py | paolodelia99/py-pacman | 4 | 6625796 | <filename>examples/wrappers.py
import gym
import torch
import numpy as np
import torchvision.transforms as T
from gym.spaces import Box
class SkipFrame(gym.Wrapper):
def __init__(self, env, skip):
"""Return only every `skip`-th frame"""
super().__init__(env)
self._skip = skip
def step... | <filename>examples/wrappers.py
import gym
import torch
import numpy as np
import torchvision.transforms as T
from gym.spaces import Box
class SkipFrame(gym.Wrapper):
def __init__(self, env, skip):
"""Return only every `skip`-th frame"""
super().__init__(env)
self._skip = skip
def step... | en | 0.71435 | Return only every `skip`-th frame Repeat action, and sum reward # Accumulate reward and repeat the same action # permute [H, W, C] array to [C, H, W] tensor | 2.494882 | 2 |
idseq_pipeline/commands/postprocess_functions.py | cdebourcy/idseq-pipeline | 0 | 6625797 | <filename>idseq_pipeline/commands/postprocess_functions.py
import os
import subprocess
import json
import shelve
import logging
import idseq_pipeline.commands.accessionid2seq_functions as accessionid2seq_functions
from .common import * #pylint: disable=wildcard-import
# data directories
# from common import ROOT_DIR
... | <filename>idseq_pipeline/commands/postprocess_functions.py
import os
import subprocess
import json
import shelve
import logging
import idseq_pipeline.commands.accessionid2seq_functions as accessionid2seq_functions
from .common import * #pylint: disable=wildcard-import
# data directories
# from common import ROOT_DIR
... | en | 0.786436 | #pylint: disable=wildcard-import # data directories # from common import ROOT_DIR # from common import REF_DIR # generated data go here # tmp directory with a lot of space for sorting large files # arguments from environment variables # input files # output files # target outputs by task # Processing functions Return m... | 2.172007 | 2 |
test/format/conftest.py | di/pip-audit | 1 | 6625798 | <reponame>di/pip-audit
from typing import Dict, List
import pytest
from packaging.version import Version
import pip_audit.service as service
_TEST_VULN_DATA: Dict[service.Dependency, List[service.VulnerabilityResult]] = {
service.Dependency(package="foo", version="1.0"): [
service.VulnerabilityResult(
... | from typing import Dict, List
import pytest
from packaging.version import Version
import pip_audit.service as service
_TEST_VULN_DATA: Dict[service.Dependency, List[service.VulnerabilityResult]] = {
service.Dependency(package="foo", version="1.0"): [
service.VulnerabilityResult(
id="VULN-0",
... | none | 1 | 2.137778 | 2 | |
Day - 3 - Binary Diagnostic/input.py | HarshRaj2717/AOC-2021-Solutions | 0 | 6625799 | <reponame>HarshRaj2717/AOC-2021-Solutions
input_text = '''00100
11110
10110
10111
10101
01111
00111
11100
10000
11001
00010
01010'''
input_text = list(input_text.split("\n"))
| input_text = '''00100
11110
10110
10111
10101
01111
00111
11100
10000
11001
00010
01010'''
input_text = list(input_text.split("\n")) | es | 0.077664 | 00100 11110 10110 10111 10101 01111 00111 11100 10000 11001 00010 01010 | 2.172735 | 2 |
cookieproject/tests/test_data.py | Markussorensen/mlops_exercises | 0 | 6625800 | <filename>cookieproject/tests/test_data.py<gh_stars>0
import numpy as np
import torch
from torch.utils.data import DataLoader
from src.data.make_dataset import MNISTDataset
import hydra
@hydra.main(config_path="../configs", config_name="config.yaml")
def main(config):
N_train = 25000
N_test = 5000
trai... | <filename>cookieproject/tests/test_data.py<gh_stars>0
import numpy as np
import torch
from torch.utils.data import DataLoader
from src.data.make_dataset import MNISTDataset
import hydra
@hydra.main(config_path="../configs", config_name="config.yaml")
def main(config):
N_train = 25000
N_test = 5000
trai... | none | 1 | 2.392794 | 2 | |
src/diskpool/azext_diskpool/vendored_sdks/storagepool/models/_models_py3.py | wwendyc/azure-cli-extensions | 1 | 6625801 | <filename>src/diskpool/azext_diskpool/vendored_sdks/storagepool/models/_models_py3.py<gh_stars>1-10
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project roo... | <filename>src/diskpool/azext_diskpool/vendored_sdks/storagepool/models/_models_py3.py<gh_stars>1-10
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project roo... | en | 0.692329 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ... | 1.829022 | 2 |
src/spn/structure/leaves/histogram/Moment.py | tkrons/SPFlow_topdownrules | 199 | 6625802 | <gh_stars>100-1000
"""
Created on April 15, 2018
@author: <NAME>
@author: <NAME>
"""
import numpy as np
from spn.algorithms.stats.Moments import add_node_moment
from spn.structure.StatisticalTypes import MetaType
from spn.structure.leaves.histogram.Histograms import Histogram
import logging
logger = logging.getLogg... | """
Created on April 15, 2018
@author: <NAME>
@author: <NAME>
"""
import numpy as np
from spn.algorithms.stats.Moments import add_node_moment
from spn.structure.StatisticalTypes import MetaType
from spn.structure.leaves.histogram.Histograms import Histogram
import logging
logger = logging.getLogger(__name__)
def ... | en | 0.771292 | Created on April 15, 2018 @author: <NAME> @author: <NAME> | 2.86622 | 3 |
tests/test_Actuation.py | landrs-toolkit/PySOSA | 1 | 6625803 | <reponame>landrs-toolkit/PySOSA
import unittest
from PySOSA import Actuation
from PySOSA import FeatureOfInterest
class MyTestCase(unittest.TestCase):
def test_add_featureOfInterest(self):
"""
creates an FOI object and test add feature of interest to Actuation
"""
a1 = Actuation("... | import unittest
from PySOSA import Actuation
from PySOSA import FeatureOfInterest
class MyTestCase(unittest.TestCase):
def test_add_featureOfInterest(self):
"""
creates an FOI object and test add feature of interest to Actuation
"""
a1 = Actuation("Actuation 1", "switch on thermom... | en | 0.775985 | creates an FOI object and test add feature of interest to Actuation | 3.062022 | 3 |
app/main.py | chiatk/tforty-api | 0 | 6625804 | <reponame>chiatk/tforty-api<gh_stars>0
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.middleware.cors import CORSMiddleware
from .routes.user import user
from .routes.campaign import campaign
from .routes.perk import perk
from .routes.donation import donation
app = FastAPI()
app.... | from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.middleware.cors import CORSMiddleware
from .routes.user import user
from .routes.campaign import campaign
from .routes.perk import perk
from .routes.donation import donation
app = FastAPI()
app.mount("/media", StaticFiles(directory="... | none | 1 | 1.966469 | 2 | |
statsmodels/datasets/scotland/data.py | yarikoptic/statsmodels | 1 | 6625805 | """Taxation Powers Vote for the Scottish Parliament 1997 dataset."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Used with express permission from the original author,
who retains all rights."""
TITLE = "Taxation Powers Vote for the Scottish Parliamant 1997"
SOURCE = """
<NAME>'s `Generalized Linea... | """Taxation Powers Vote for the Scottish Parliament 1997 dataset."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Used with express permission from the original author,
who retains all rights."""
TITLE = "Taxation Powers Vote for the Scottish Parliamant 1997"
SOURCE = """
<NAME>'s `Generalized Linea... | en | 0.899116 | Taxation Powers Vote for the Scottish Parliament 1997 dataset. Used with express permission from the original author, who retains all rights. <NAME>'s `Generalized Linear Models: A Unified Approach` http://jgill.wustl.edu/research/books.html Taxation Powers' Yes Vote for Scottish Parliamanet-1997 This data is based on... | 2.483541 | 2 |
Lib/strategies/zscore_trend.py | DylanScotney/cryptocurrency_backtesting | 0 | 6625806 | <reponame>DylanScotney/cryptocurrency_backtesting
from matplotlib import pyplot as plt
import pandas as pd
from .abstract_MA import movingAverageTrader
from ..types.zscore import zScore
class zScoreTrader(movingAverageTrader):
"""
A class that backtests a z score and MA based trading algorithm
which atte... | from matplotlib import pyplot as plt
import pandas as pd
from .abstract_MA import movingAverageTrader
from ..types.zscore import zScore
class zScoreTrader(movingAverageTrader):
"""
A class that backtests a z score and MA based trading algorithm
which attempts to capitalise on the over compensation of mov... | en | 0.732089 | A class that backtests a z score and MA based trading algorithm which attempts to capitalise on the over compensation of moves in the cryptocurrency market. Returns are stored under df['returns']. Refer to base class, movingAverageTrading for more details. Uses a (typically longer) moving average ... | 3.169036 | 3 |
utilities/statistics_utilities/episode_statistics.py | bootml/agent | 0 | 6625807 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'cnheider'
import numpy as np
class EpisodeStatistics(object):
def __init__(self):
super().__init__()
durations = []
signals = []
def moving_average(self, window_size=100):
signal_ma = np.mean(self.signals[-window_size:])
duration_ma ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'cnheider'
import numpy as np
class EpisodeStatistics(object):
def __init__(self):
super().__init__()
durations = []
signals = []
def moving_average(self, window_size=100):
signal_ma = np.mean(self.signals[-window_size:])
duration_ma ... | en | 0.308914 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- | 2.667539 | 3 |
LSTM/lstm_model.py | dannytse/crypto-priceanalysis | 1 | 6625808 | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers as layers
from keras.models import Sequential
from keras.layers import Activation, Dense, Dropout, LSTM
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.metrics import mean_a... | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers as layers
from keras.models import Sequential
from keras.layers import Activation, Dense, Dropout, LSTM
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.metrics import mean_a... | en | 0.539719 | batch_size = tf.shape(features)[0] n_outputs = tf.shape(labels)[1] initial_state = tf.zeros([batch_size, num_layers * cell_size]) # RNN cells = layers.StackedRNNCells([layers.GRUCell(cell_size) for _ in range(num_layers)]) rnn_layer = layers.RNN(cells) rnn_output = rnn_layer(features, initi... | 3.019412 | 3 |
dask/array/optimization.py | callumanoble/dask | 0 | 6625809 | <reponame>callumanoble/dask<filename>dask/array/optimization.py
from itertools import zip_longest
from operator import getitem
import numpy as np
from .core import getter, getter_nofancy, getter_inline
from ..blockwise import optimize_blockwise, fuse_roots
from ..core import flatten, reverse_dict
from ..optimization ... | from itertools import zip_longest
from operator import getitem
import numpy as np
from .core import getter, getter_nofancy, getter_inline
from ..blockwise import optimize_blockwise, fuse_roots
from ..core import flatten, reverse_dict
from ..optimization import fuse, inline_functions
from ..utils import ensure_dict
fr... | en | 0.788073 | # All get* functions the optimizations know about # These get* functions aren't ever completely removed from the graph, # even if the index should be a no-op by numpy semantics. Some array-like's # don't completely follow semantics, making indexing always necessary. Optimize dask for array computation 1. Cull tas... | 2.07661 | 2 |
cle/backends/elf/source_manager.py | yuzeming/cle | 0 | 6625810 | <filename>cle/backends/elf/source_manager.py
import logging
import os
from elftools.dwarf.dwarfinfo import DWARFInfo
from elftools.elf.elffile import ELFFile
from elftools.dwarf.lineprogram import LineProgramEntry, LineState
l = logging.getLogger(__name__)
class SourceInfoEntry(object):
def __init__(self, fn:str... | <filename>cle/backends/elf/source_manager.py
import logging
import os
from elftools.dwarf.dwarfinfo import DWARFInfo
from elftools.elf.elffile import ELFFile
from elftools.dwarf.lineprogram import LineProgramEntry, LineState
l = logging.getLogger(__name__)
class SourceInfoEntry(object):
def __init__(self, fn:str... | en | 0.257364 | # type: list[SourceInfoEntry] | 2.348353 | 2 |
python/testData/intentions/PythonDemorganLawIntentionTest/complex.py | jnthn/intellij-community | 2 | 6625811 | <reponame>jnthn/intellij-community<gh_stars>1-10
a = True
b = False
c = True
d = False
#before intention
if a and b and c or<caret> d:
print "before"
| a = True
b = False
c = True
d = False
#before intention
if a and b and c or<caret> d:
print "before" | en | 0.639194 | #before intention | 2.633858 | 3 |
collatz.py | danj7/Collatz-Mapper | 0 | 6625812 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.animation as anim
import sys
def collatz_mapper(amax, bmax, div=2, nlim=20):
"""
Returns a Numpy array with the Collatz Map. Utilizes ints to build the map.
Parameters
----------
amax: int
... | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.animation as anim
import sys
def collatz_mapper(amax, bmax, div=2, nlim=20):
"""
Returns a Numpy array with the Collatz Map. Utilizes ints to build the map.
Parameters
----------
amax: int
... | en | 0.571819 | Returns a Numpy array with the Collatz Map. Utilizes ints to build the map. Parameters ---------- amax: int Maximum positive 'a' value of the map (horizontal axis). The map goes from -amax to amax. bmax: int Maximum positive 'b' value of the map (vertical axis). The map goes ... | 3.368936 | 3 |
web/api/maestro_api/db/mongo.py | Farfetch/maestro | 21 | 6625813 | from mongoengine import connect
from maestro_api.db.repo.user import UserRepository
from maestro_api.db.models.user import UserRole
def init_db(flask_app=None):
connect(**flask_app.config["MONGODB_SETTINGS"])
def init_db_data(flask_app):
"Init DB initial data"
if flask_app.config["OAUTH_ENABLED"] is Fa... | from mongoengine import connect
from maestro_api.db.repo.user import UserRepository
from maestro_api.db.models.user import UserRole
def init_db(flask_app=None):
connect(**flask_app.config["MONGODB_SETTINGS"])
def init_db_data(flask_app):
"Init DB initial data"
if flask_app.config["OAUTH_ENABLED"] is Fa... | none | 1 | 2.074078 | 2 | |
src/azure-cli/azure/cli/command_modules/acr/_docker_utils.py | WCollins3/azure-cli | 1 | 6625814 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | en | 0.759035 | # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------... | 1.840435 | 2 |
src/main.py | glovguy/survey_cluster | 0 | 6625815 | <reponame>glovguy/survey_cluster
import json
from models.surveys import Surveys
from models.clusters import KmeansClusters
from cluster_diagram import generate_diagram
from silouette_scores import find_best_clust_num
data_raw = [
{'survey_text': 'The quick brown fox jumps over the lazy dog', 'surveyid': '1'},
... | import json
from models.surveys import Surveys
from models.clusters import KmeansClusters
from cluster_diagram import generate_diagram
from silouette_scores import find_best_clust_num
data_raw = [
{'survey_text': 'The quick brown fox jumps over the lazy dog', 'surveyid': '1'},
{'survey_text': 'Some days requi... | none | 1 | 2.570536 | 3 | |
lccs_ws/views.py | brazil-data-cube/lccs-ws | 2 | 6625816 | <filename>lccs_ws/views.py
#
# This file is part of Land Cover Classification System Web Service.
# Copyright (C) 2020-2021 INPE.
#
# Land Cover Classification System Web Service is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""View... | <filename>lccs_ws/views.py
#
# This file is part of Land Cover Classification System Web Service.
# Copyright (C) 2020-2021 INPE.
#
# Land Cover Classification System Web Service is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""View... | en | 0.549465 | # # This file is part of Land Cover Classification System Web Service. # Copyright (C) 2020-2021 INPE. # # Land Cover Classification System Web Service is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. # Views of Land Cover Classification... | 2.236409 | 2 |
multirun/deps.bzl | shiwano/bazel-tools | 118 | 6625817 | <reponame>shiwano/bazel-tools
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def multirun_dependencies():
maybe(
http_archive,
name = "bazel_skylib",
urls = [
"https://mirror.bazel.build/github.... | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def multirun_dependencies():
maybe(
http_archive,
name = "bazel_skylib",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/re... | none | 1 | 1.486008 | 1 | |
plugins/extract/_base.py | aaman123/faceswap | 2 | 6625818 | <gh_stars>1-10
#!/usr/bin/env python3
""" Base class for Faceswap :mod:`~plugins.extract.detect`, :mod:`~plugins.extract.align` and
:mod:`~plugins.extract.mask` Plugins
"""
import logging
import os
import sys
from tensorflow.python import errors_impl as tf_errors # pylint:disable=no-name-in-module
from lib.multithre... | #!/usr/bin/env python3
""" Base class for Faceswap :mod:`~plugins.extract.detect`, :mod:`~plugins.extract.align` and
:mod:`~plugins.extract.mask` Plugins
"""
import logging
import os
import sys
from tensorflow.python import errors_impl as tf_errors # pylint:disable=no-name-in-module
from lib.multithreading import Mu... | en | 0.730543 | #!/usr/bin/env python3 Base class for Faceswap :mod:`~plugins.extract.detect`, :mod:`~plugins.extract.align` and :mod:`~plugins.extract.mask` Plugins # pylint:disable=no-name-in-module # pylint: disable=invalid-name # TODO CPU mode # TODO Run with warnings mode Return the configuration for the requested model Para... | 2.176684 | 2 |
pyplan/pyplan/preference_module/serializers.py | jorgedouglas71/pyplan-ide | 17 | 6625819 | <reponame>jorgedouglas71/pyplan-ide<gh_stars>10-100
from rest_framework import serializers
from .models import PreferenceModule
class PreferenceModuleSerializer(serializers.ModelSerializer):
class Meta:
model = PreferenceModule
fields = '__all__'
| from rest_framework import serializers
from .models import PreferenceModule
class PreferenceModuleSerializer(serializers.ModelSerializer):
class Meta:
model = PreferenceModule
fields = '__all__' | none | 1 | 1.6972 | 2 | |
examples/mysql.py | vamshi091211/pyinfra | 1 | 6625820 | from pyinfra import host, state
from pyinfra.operations import apt, files, mysql, python
SUDO = True
if host.fact.linux_name != 'Debian':
# Raises an exception mid-deploy
python.raise_exception(
{'Ensure we are Debian'},
NotImplementedError,
'`mysql.py` only works on Debian',
)
... | from pyinfra import host, state
from pyinfra.operations import apt, files, mysql, python
SUDO = True
if host.fact.linux_name != 'Debian':
# Raises an exception mid-deploy
python.raise_exception(
{'Ensure we are Debian'},
NotImplementedError,
'`mysql.py` only works on Debian',
)
... | en | 0.433261 | # Raises an exception mid-deploy # Setup a MySQL role & database # # Upload & import a SQL file into the pyinfra_stuff database # # Now duplicate the pyinfra_stuff database -> pyinfra_stuff_copy # | 2.402385 | 2 |
python/lbann/modules/graph/utils.py | aj-prime/lbann | 0 | 6625821 | import lbann
from lbann.util import str_list
class GraphVertexData:
def __init__(self, layers, num_features):
"""Object to hold list of layers, where each layer represents a vertex
in a graph.
Args:
layers (iterator of layers): One dimensional iterator of node
... | import lbann
from lbann.util import str_list
class GraphVertexData:
def __init__(self, layers, num_features):
"""Object to hold list of layers, where each layer represents a vertex
in a graph.
Args:
layers (iterator of layers): One dimensional iterator of node
... | en | 0.81183 | Object to hold list of layers, where each layer represents a vertex in a graph. Args: layers (iterator of layers): One dimensional iterator of node features with N number of ndoes num_features (int) : the number of feature... | 3.217636 | 3 |
meta.py | mayur295/MetaDesktopAssistant- | 0 | 6625822 | #This a python project that focuses on development of basic desktop assistant
#---**********************---
#import module pyttsx3 which is used for coversion of text into speech
# init function to get an engine instance for the speech synthesis (formation)
# sapi5 is API which allows the use of speech recogni... | #This a python project that focuses on development of basic desktop assistant
#---**********************---
#import module pyttsx3 which is used for coversion of text into speech
# init function to get an engine instance for the speech synthesis (formation)
# sapi5 is API which allows the use of speech recogni... | en | 0.848647 | #This a python project that focuses on development of basic desktop assistant #---**********************--- #import module pyttsx3 which is used for coversion of text into speech # init function to get an engine instance for the speech synthesis (formation) # sapi5 is API which allows the use of speech recognition(user... | 3.653066 | 4 |
sdk/python/pulumi_azure_nextgen/machinelearning/list_workspace_keys.py | pulumi/pulumi-azure-nextgen | 31 | 6625823 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
__al... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
__al... | en | 0.866014 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** Workspace authorization keys for a workspace. Primary authorization key for this workspace. Secondary authorization key for this workspace. # pylint: di... | 1.758427 | 2 |
l-system_tree.py | dangbb/3D_L-System_Tree | 7 | 6625824 | <gh_stars>1-10
# Filename: l-system_tree.py
# Author: <NAME> (@def-pri-pub)
# License: BSD 3-Clause (read `./LICENSE` for details)
#
# This script is the logic for generating a Lindenmayer System tree. It's
# needs to be run inside of Blender for it to work. When it's done genrating
# you should be given a tree-li... | # Filename: l-system_tree.py
# Author: <NAME> (@def-pri-pub)
# License: BSD 3-Clause (read `./LICENSE` for details)
#
# This script is the logic for generating a Lindenmayer System tree. It's
# needs to be run inside of Blender for it to work. When it's done genrating
# you should be given a tree-like structure ma... | en | 0.848232 | # Filename: l-system_tree.py # Author: <NAME> (@def-pri-pub) # License: BSD 3-Clause (read `./LICENSE` for details) # # This script is the logic for generating a Lindenmayer System tree. It's # needs to be run inside of Blender for it to work. When it's done genrating # you should be given a tree-like structure ma... | 2.765174 | 3 |
lnbits/extensions/lnticket/views_api.py | pseudozach/lnbits-legend | 76 | 6625825 | import re
from http import HTTPStatus
from fastapi import Query
from fastapi.params import Depends
from starlette.exceptions import HTTPException
from lnbits.core.crud import get_user
from lnbits.core.services import create_invoice
from lnbits.core.views.api import api_payment
from lnbits.decorators import WalletType... | import re
from http import HTTPStatus
from fastapi import Query
from fastapi.params import Depends
from starlette.exceptions import HTTPException
from lnbits.core.crud import get_user
from lnbits.core.services import create_invoice
from lnbits.core.views.api import api_payment
from lnbits.decorators import WalletType... | de | 0.442539 | # FORMS #########tickets########## | 2.019866 | 2 |
core/acl_old.py | Caledor/dl | 22 | 6625826 | <gh_stars>10-100
import sys
from core.timeline import now, Timeline
import re
do_act = None
def acl_func_str(acl):
global do_act
s = acl_str(acl_build(acl))
exec(s, globals())
# return do_act_list, s
do_act = do_act_list
return s, do_act_list
class Acl_Action:
INDENT = " "
PREP =... | import sys
from core.timeline import now, Timeline
import re
do_act = None
def acl_func_str(acl):
global do_act
s = acl_str(acl_build(acl))
exec(s, globals())
# return do_act_list, s
do_act = do_act_list
return s, do_act_list
class Acl_Action:
INDENT = " "
PREP = """ try:
... | en | 0.340939 | # return do_act_list, s try: {act} = self.{act} except Exception: raise AttributeError('{act} is not an action') {indent}if {act}({args}): {indent} return '{act}' {indent}Acl_Control.AQU.append(({act}, compile('{cond}', '<string>', 'eval'))) # self.condition = condition {indent}if {cond}: {block}... | 2.915019 | 3 |
pimgen.py | rfrandse/phosphor-inventory-manager | 0 | 6625827 | #!/usr/bin/env python
'''Phosphor Inventory Manager YAML parser and code generator.
The parser workflow is broken down as follows:
1 - Import YAML files as native python type(s) instance(s).
2 - Create an instance of the Everything class from the
native python type instance(s) with the Everything.load
... | #!/usr/bin/env python
'''Phosphor Inventory Manager YAML parser and code generator.
The parser workflow is broken down as follows:
1 - Import YAML files as native python type(s) instance(s).
2 - Create an instance of the Everything class from the
native python type instance(s) with the Everything.load
... | en | 0.767482 | #!/usr/bin/env python Phosphor Inventory Manager YAML parser and code generator. The parser workflow is broken down as follows: 1 - Import YAML files as native python type(s) instance(s). 2 - Create an instance of the Everything class from the native python type instance(s) with the Everything.load ... | 2.707089 | 3 |
award/models.py | ivxxi/Django3 | 0 | 6625828 | from django.db import models
from tinymce.models import HTMLField
from django.contrib.auth.models import User
# Create your models here.
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_picture = models.ImageField(upload_to='images/')
bio = models.TextField(m... | from django.db import models
from tinymce.models import HTMLField
from django.contrib.auth.models import User
# Create your models here.
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_picture = models.ImageField(upload_to='images/')
bio = models.TextField(m... | en | 0.963489 | # Create your models here. | 2.257877 | 2 |
protonfixes/gamefixes/200260.py | Citiroller/protonfixes | 213 | 6625829 | """ Game fix Batman Arkham City
"""
#pylint: disable=C0103
from protonfixes import util
from protonfixes.protonversion import DeprecatedSince
@DeprecatedSince("5.0-3")
def main():
""" Probably not needed when proton will be merged with newer wine
"""
util.protontricks('dotnet20')
util.protontricks('do... | """ Game fix Batman Arkham City
"""
#pylint: disable=C0103
from protonfixes import util
from protonfixes.protonversion import DeprecatedSince
@DeprecatedSince("5.0-3")
def main():
""" Probably not needed when proton will be merged with newer wine
"""
util.protontricks('dotnet20')
util.protontricks('do... | en | 0.745645 | Game fix Batman Arkham City #pylint: disable=C0103 Probably not needed when proton will be merged with newer wine #pylint: disable=protected-access #TODO Checking possibly some tweak for language detection | 1.441947 | 1 |
tests/components/mqtt/test_light.py | europrimus/core | 0 | 6625830 | <filename>tests/components/mqtt/test_light.py
"""The tests for the MQTT light platform.
Configuration for RGB Version with brightness:
light:
platform: mqtt
name: "Office Light RGB"
state_topic: "office/rgb1/light/status"
command_topic: "office/rgb1/light/switch"
brightness_state_topic: "office/rgb1/brightn... | <filename>tests/components/mqtt/test_light.py
"""The tests for the MQTT light platform.
Configuration for RGB Version with brightness:
light:
platform: mqtt
name: "Office Light RGB"
state_topic: "office/rgb1/light/status"
command_topic: "office/rgb1/light/switch"
brightness_state_topic: "office/rgb1/brightn... | en | 0.76188 | The tests for the MQTT light platform. Configuration for RGB Version with brightness: light: platform: mqtt name: "Office Light RGB" state_topic: "office/rgb1/light/status" command_topic: "office/rgb1/light/switch" brightness_state_topic: "office/rgb1/brightness/status" brightness_command_topic: "office/r... | 1.755629 | 2 |
tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper_unittest.py | tmpsantos/chromium | 0 | 6625831 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import glob
import os
import pickle
import re
import shutil
import tempfile
import unittest
from telemetry import benchmark
from telemetry.core import util
... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import glob
import os
import pickle
import re
import shutil
import tempfile
import unittest
from telemetry import benchmark
from telemetry.core import util
... | en | 0.902095 | # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=W0212 # pylint: disable=W0212 # Make sure we found at least one unstripped library. # Check that we have kernel symbols. # Check that all re... | 1.95963 | 2 |
ansible/modules/utilities/helper/meta.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 1 | 6625832 | <reponame>EnjoyLifeFund/macHighSierra-py36-pkgs
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Ansible, a Red Hat company
# 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_... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Ansible, a Red Hat company
# 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.828389 | #!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, a Red Hat company # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) module: meta short_description: Execute Ansible 'actions' version_added: "1.2" description: - Meta tasks are a special kind of task which can ... | 1.769556 | 2 |
utils/helper.py | avalanchesiqi/twitter-sampling | 1 | 6625833 | <gh_stars>1-10
import time
from datetime import datetime, timedelta
class Timer:
def __init__(self):
self.start_time = None
def start(self):
self.start_time = time.time()
def stop(self):
print('>>> Elapsed time: {0}\n'.format(str(timedelta(seconds=time.time() - self.start_time))[... | import time
from datetime import datetime, timedelta
class Timer:
def __init__(self):
self.start_time = None
def start(self):
self.start_time = time.time()
def stop(self):
print('>>> Elapsed time: {0}\n'.format(str(timedelta(seconds=time.time() - self.start_time))[:-3]))
def st... | en | 0.624142 | # twitter's snowflake parameters generate a twitter-snowflake id, based on https://github.com/twitter/snowflake/blob/master/src/main/scala/com/twitter/service/snowflake/IdWorker.scala :param: timestamp_ms time since UNIX epoch in milliseconds inversely transform a snowflake id back to its components. | 3.197995 | 3 |
app/gui.py | jakubsolecki/Team-Locator | 0 | 6625834 | from time import sleep
from kivy.app import App
from kivy.properties import ObjectProperty, StringProperty
from kivy.uix.gridlayout import GridLayout
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.treeview import TreeViewLabel
from kivy.uix.popup import Popup
from kivy.uix.floatlayout import Flo... | from time import sleep
from kivy.app import App
from kivy.properties import ObjectProperty, StringProperty
from kivy.uix.gridlayout import GridLayout
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.treeview import TreeViewLabel
from kivy.uix.popup import Popup
from kivy.uix.floatlayout import Flo... | en | 0.872304 | # from app.client import Client # Expected to change. If players stay black something is wrong # Additional safety, should never happen # after pressing "Host Game" button: # after pressing "Connect Game" button: # Takes first letter as number from 0 to 9: || #1ABCD means color 1 || # GPS always starts in AGH WIEiT fac... | 2.28657 | 2 |
k2/python/tests/shortest_path_test.py | Jarvan-Wang/k2 | 0 | 6625835 | <gh_stars>0
#!/usr/bin/env python3
#
# Copyright (c) 2020 Mobvoi Inc. (authors: <NAME>)
#
# See ../../../LICENSE for clarification regarding multiple authors
# To run this single test, use
#
# ctest --verbose -R shortest_path_test_py
import unittest
import k2
import torch
class TestShortestPath(unittest.... | #!/usr/bin/env python3
#
# Copyright (c) 2020 Mobvoi Inc. (authors: <NAME>)
#
# See ../../../LICENSE for clarification regarding multiple authors
# To run this single test, use
#
# ctest --verbose -R shortest_path_test_py
import unittest
import k2
import torch
class TestShortestPath(unittest.TestCase):
... | en | 0.467052 | #!/usr/bin/env python3 # # Copyright (c) 2020 Mobvoi Inc. (authors: <NAME>) # # See ../../../LICENSE for clarification regarding multiple authors # To run this single test, use # # ctest --verbose -R shortest_path_test_py 0 4 1 1 0 1 1 1 1 2 1 2 1 3 1 3 2 7 1 4 ... | 2.815456 | 3 |
train_quant.py | Roxbili/kws-demo | 0 | 6625836 | # 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.822123 | # 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... | 2.429794 | 2 |
click2pass/urls.py | iwagaki/click2pass | 0 | 6625837 | <filename>click2pass/urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'click2pass.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.u... | <filename>click2pass/urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'click2pass.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.u... | en | 0.264136 | # Examples: # url(r'^$', 'click2pass.views.home', name='home'), # url(r'^blog/', include('blog.urls')), | 1.994119 | 2 |
net/net_nacl.gyp | domenic/mojo | 5 | 6625838 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'includes': [
'../native_client/build/untrusted.gypi',
'net.gypi',
],
'targets': [
{
... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'includes': [
'../native_client/build/untrusted.gypi',
'net.gypi',
],
'targets': [
{
... | en | 0.917765 | # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. | 1.173097 | 1 |
itdagene/core/migrations/0017_remove_user_mail_prefix.py | itdagene-ntnu/itdagene | 9 | 6625839 | <reponame>itdagene-ntnu/itdagene<filename>itdagene/core/migrations/0017_remove_user_mail_prefix.py<gh_stars>1-10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0016_auto_20141007_2055")]
operations = [migrati... | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0016_auto_20141007_2055")]
operations = [migrations.RemoveField(model_name="user", name="mail_prefix")] | none | 1 | 1.390406 | 1 | |
tests/vfs/encrypted_stream_file_system.py | Acidburn0zzz/dfvfs | 1 | 6625840 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the encrypted stream file system implementation."""
from __future__ import unicode_literals
import unittest
from dfvfs.lib import definitions
from dfvfs.path import encrypted_stream_path_spec
from dfvfs.path import os_path_spec
from dfvfs.resolver import con... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the encrypted stream file system implementation."""
from __future__ import unicode_literals
import unittest
from dfvfs.lib import definitions
from dfvfs.path import encrypted_stream_path_spec
from dfvfs.path import os_path_spec
from dfvfs.resolver import con... | en | 0.852492 | #!/usr/bin/env python # -*- coding: utf-8 -*- Tests for the encrypted stream file system implementation. Tests the compressed stream file system. Sets up the needed objects used throughout the test. Test the open and close functionality. Test the file entry exists by path specification functionality. Tests the GetFileE... | 2.393392 | 2 |
pyalect/shims.py | rmorshea/pyalect | 4 | 6625841 | import ast
import sys
from traceback import print_exc
from typing import Any, List, Optional, Type
from .dialect import DialectReducer, dialect_reducer
try:
from IPython.core.interactiveshell import InteractiveShell
from IPython.core.magic import magics_class, Magics, cell_magic
except ImportError:
pass
e... | import ast
import sys
from traceback import print_exc
from typing import Any, List, Optional, Type
from .dialect import DialectReducer, dialect_reducer
try:
from IPython.core.interactiveshell import InteractiveShell
from IPython.core.magic import magics_class, Magics, cell_magic
except ImportError:
pass
e... | en | 0.835855 | Node transformer defined to hook into IPython. Register transpiler hooks to IPython shell. # type: ignore # type: ignore # We need to prepend this since we can't look for # the dialect comment when transforming the AST. | 2.034158 | 2 |
medium/260-Single Number III.py | Davidxswang/leetcode | 2 | 6625842 | <reponame>Davidxswang/leetcode
"""
https://leetcode.com/problems/single-number-iii/
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.
Example:
Input: [1,2,1,3,2,5]
Output: [3,5]
Note:
The orde... | """
https://leetcode.com/problems/single-number-iii/
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.
Example:
Input: [1,2,1,3,2,5]
Output: [3,5]
Note:
The order of the result is not importan... | en | 0.890938 | https://leetcode.com/problems/single-number-iii/ Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. Example: Input: [1,2,1,3,2,5] Output: [3,5] Note: The order of the result is not important. S... | 3.899644 | 4 |
tests/test_target_space.py | 1aut/BayesianOptimization | 6,106 | 6625843 | import pytest
import numpy as np
from bayes_opt.target_space import TargetSpace
def target_func(**kwargs):
# arbitrary target func
return sum(kwargs.values())
PBOUNDS = {'p1': (0, 1), 'p2': (1, 100)}
def test_keys_and_bounds_in_same_order():
pbounds = {
'p1': (0, 1),
'p3': (0, 3),
... | import pytest
import numpy as np
from bayes_opt.target_space import TargetSpace
def target_func(**kwargs):
# arbitrary target func
return sum(kwargs.values())
PBOUNDS = {'p1': (0, 1), 'p2': (1, 100)}
def test_keys_and_bounds_in_same_order():
pbounds = {
'p1': (0, 1),
'p3': (0, 3),
... | en | 0.734463 | # arbitrary target func # registering with dict # registering with array # probing with dict # probing with array # probing same point with dict # probing same point with array # Ignore unknown keys # Update bounds accordingly CommandLine: python tests/test_target_space.py | 2.173089 | 2 |
wevote_functions/tests.py | adborden/WeVoteBase | 0 | 6625844 | <reponame>adborden/WeVoteBase
# wevote_functions/tests.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.test import TestCase
# Create your tests here.
| # wevote_functions/tests.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.test import TestCase
# Create your tests here. | en | 0.841974 | # wevote_functions/tests.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- # Create your tests here. | 1.233027 | 1 |
nova/api/openstack/compute/plugins/v3/instance_actions.py | bopopescu/nova-master | 3 | 6625845 | <reponame>bopopescu/nova-master<filename>nova/api/openstack/compute/plugins/v3/instance_actions.py<gh_stars>1-10
# Copyright 2013 Rackspace Hosting
# 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 ... | # Copyright 2013 Rackspace Hosting
# 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 require... | en | 0.860044 | # Copyright 2013 Rackspace Hosting # 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 require... | 1.734924 | 2 |
src/euler_python_package/euler_python/medium/p318.py | wilsonify/euler | 0 | 6625846 | def problem318():
pass
| def problem318():
pass
| none | 1 | 0.875471 | 1 | |
nodular_JJ/finite_sc/Vj scan/E_Vj.py | tbcole/majoranaJJ | 0 | 6625847 | <reponame>tbcole/majoranaJJ<filename>nodular_JJ/finite_sc/Vj scan/E_Vj.py<gh_stars>0
import sys
import os
import numpy as np
import gc
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.patches as patches
import scipy.sparse as sparse
import scipy.linalg as LA
import scipy.sparse.linalg as sp... | scan/E_Vj.py<gh_stars>0
import sys
import os
import numpy as np
import gc
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.patches as patches
import scipy.sparse as sparse
import scipy.linalg as LA
import scipy.sparse.linalg as spLA
import majoranaJJ.operators.sparse.qmsops as spop #sparse... | en | 0.509114 | #sparse operators #neighbor arrays #lattice shapes #plotting functions #potential JJ ################################################### #Defining System #Number of lattice sites along x-direction #Number of lattice sites along y-direction #lattice spacing in x-direction: [A] #lattice spacing in y-direction: [A] #Junct... | 2.245164 | 2 |
congress/api/row_model.py | poobalan-arumugam/congress | 0 | 6625848 | # Copyright (c) 2014 VMware, 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 b... | # Copyright (c) 2014 VMware, 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 b... | en | 0.802917 | # Copyright (c) 2014 VMware, 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 b... | 2.299921 | 2 |
tools/plotjuggler/juggle.py | aolin480/openpilot | 70 | 6625849 | <filename>tools/plotjuggler/juggle.py
#!/usr/bin/env python3
import os
import sys
import multiprocessing
import platform
import shutil
import subprocess
import tarfile
import tempfile
import requests
import argparse
from common.basedir import BASEDIR
from selfdrive.test.process_replay.compare_logs import save_log
from... | <filename>tools/plotjuggler/juggle.py
#!/usr/bin/env python3
import os
import sys
import multiprocessing
import platform
import shutil
import subprocess
import tarfile
import tempfile
import requests
import argparse
from common.basedir import BASEDIR
from selfdrive.test.process_replay.compare_logs import save_log
from... | en | 0.421663 | #!/usr/bin/env python3 # Infer DBC name from logs | 1.876137 | 2 |
nli_mixed_models/eval/nli_eval.py | wgantt/nli-mixed-models | 1 | 6625850 | <reponame>wgantt/nli-mixed-models
import torch
import logging
import numpy as np
import pandas as pd
from torch.optim import Adam
from torch.nn import CrossEntropyLoss, BCEWithLogitsLoss
from ..modules.nli_base import NaturalLanguageInference
from ..modules.nli_random_intercepts import (
UnitRandomIntercepts,
... | import torch
import logging
import numpy as np
import pandas as pd
from torch.optim import Adam
from torch.nn import CrossEntropyLoss, BCEWithLogitsLoss
from ..modules.nli_base import NaturalLanguageInference
from ..modules.nli_random_intercepts import (
UnitRandomIntercepts,
CategoricalRandomIntercepts,
)
fro... | en | 0.673311 | # Tensors for accumulating predictions, targets, and modal # responses across batches. # Calculate metrics for each batch in test set # Get target values of appropriate type # Embed items # Calculate model prediction and compute fixed & random loss # Add total loss to trace # If categorical, calculate accuracy (and Spe... | 2.092568 | 2 |