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 |
|---|---|---|---|---|---|---|---|---|---|---|
python/ray/train/__init__.py | jamesliu/ray | 33 | 1700 | <filename>python/ray/train/__init__.py
from ray.train.backend import BackendConfig
from ray.train.callbacks import TrainingCallback
from ray.train.checkpoint import CheckpointStrategy
from ray.train.session import (get_dataset_shard, local_rank, load_checkpoint,
report, save_checkpoint, w... | <filename>python/ray/train/__init__.py
from ray.train.backend import BackendConfig
from ray.train.callbacks import TrainingCallback
from ray.train.checkpoint import CheckpointStrategy
from ray.train.session import (get_dataset_shard, local_rank, load_checkpoint,
report, save_checkpoint, w... | none | 1 | 1.943183 | 2 | |
test/test_contact_in_group.py | anastas11a/python_training | 0 | 1701 | <gh_stars>0
from model.contact import Contact
from model.group import Group
import random
def test_add_contact_in_group(app, db):
app.open_home_page()
contact = db.get_contact_list()
if len(contact) == 0:
app.contact.create(Contact(firstname = "test firstname changed"))
group = db.get_group_lis... | from model.contact import Contact
from model.group import Group
import random
def test_add_contact_in_group(app, db):
app.open_home_page()
contact = db.get_contact_list()
if len(contact) == 0:
app.contact.create(Contact(firstname = "test firstname changed"))
group = db.get_group_list()
if l... | none | 1 | 2.457828 | 2 | |
byurak/accounts/admin.py | LikeLion-CAU-9th/Django-fancy-coder | 0 | 1702 | <reponame>LikeLion-CAU-9th/Django-fancy-coder
from django.contrib import admin
from accounts.models import User, Profile, UserFollow
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
list_display = ['email', 'nickname']
list_display_links = ['email', 'nickname']
admin.site.register(Profile)
admin.... | from django.contrib import admin
from accounts.models import User, Profile, UserFollow
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
list_display = ['email', 'nickname']
list_display_links = ['email', 'nickname']
admin.site.register(Profile)
admin.site.register(UserFollow) | none | 1 | 1.813501 | 2 | |
viz_utils/eoa_viz.py | olmozavala/eoas-pyutils | 0 | 1703 | import os
from PIL import Image
import cv2
from os import listdir
from os.path import join
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.colors import LogNorm
from io_utils.io_common import create_folder
from viz_utils.constants import PlotMode, BackgroundType
import pylab
import numpy as np
import... | import os
from PIL import Image
import cv2
from os import listdir
from os.path import join
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.colors import LogNorm
from io_utils.io_common import create_folder
from viz_utils.constants import PlotMode, BackgroundType
import pylab
import numpy as np
import... | en | 0.662413 | Based on the name if the field it chooses a colormap from cmocean Args: field_name: Returns: # cmaps_fields.append(cmocean.cm.deep_r) This class makes plenty of plots assuming we are plotting Geospatial data (maps). It is made to read xarrays, numpy arrays, and numpy arrays in dictionaries vizo... | 2.106236 | 2 |
ade20kScripts/setup.py | fcendra/PSPnet18 | 1 | 1704 | from os import listdir
from os.path import isfile, join
from path import Path
import numpy as np
import cv2
# Dataset path
target_path = Path('target/')
annotation_images_path = Path('dataset/ade20k/annotations/training/').abspath()
dataset = [ f for f in listdir(annotation_images_path) if isfile(join(annotation_image... | from os import listdir
from os.path import isfile, join
from path import Path
import numpy as np
import cv2
# Dataset path
target_path = Path('target/')
annotation_images_path = Path('dataset/ade20k/annotations/training/').abspath()
dataset = [ f for f in listdir(annotation_images_path) if isfile(join(annotation_image... | en | 0.827729 | # Dataset path # Iterate all Training Images # Read image # Convert it to array # Conditions when the value equal less than 1, change it to 255. # If it is >= 1, increment it by -1 #Saved it to another file | 2.640576 | 3 |
src/mesh/azext_mesh/servicefabricmesh/mgmt/servicefabricmesh/models/__init__.py | Mannan2812/azure-cli-extensions | 207 | 1705 | # 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 ... | # 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 ... | 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.091972 | 1 |
Core/managers/InputPeripherals.py | Scoppio/Rogue-EVE | 2 | 1706 | <reponame>Scoppio/Rogue-EVE
import logging
from models.GenericObjects import Vector2
logger = logging.getLogger('Rogue-EVE')
class MouseController(object):
"""
Mouse controller needs the map, get over it
"""
def __init__(self, map=None, object_pool=None):
self.mouse_coord = (0, 0)
sel... | import logging
from models.GenericObjects import Vector2
logger = logging.getLogger('Rogue-EVE')
class MouseController(object):
"""
Mouse controller needs the map, get over it
"""
def __init__(self, map=None, object_pool=None):
self.mouse_coord = (0, 0)
self.map = map
self.obj... | en | 0.85998 | Mouse controller needs the map, get over it # return a string with the names of all objects under the mouse # create a list with the names of all objects at the mouse's coordinates and in FOV # join the names, separated by commas | 2.961891 | 3 |
the_unsync/thesync.py | vromanuk/async_techniques | 0 | 1707 | <gh_stars>0
from unsync import unsync
import asyncio
import datetime
import math
import aiohttp
import requests
def main():
t0 = datetime.datetime.now()
tasks = [
compute_some(),
compute_some(),
compute_some(),
download_some(),
download_some(),
download_some(),
... | from unsync import unsync
import asyncio
import datetime
import math
import aiohttp
import requests
def main():
t0 = datetime.datetime.now()
tasks = [
compute_some(),
compute_some(),
compute_some(),
download_some(),
download_some(),
download_some(),
down... | none | 1 | 2.858119 | 3 | |
sdk/python/pulumi_azure/desktopvirtualization/workspace.py | henriktao/pulumi-azure | 109 | 1708 | <filename>sdk/python/pulumi_azure/desktopvirtualization/workspace.py
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing im... | <filename>sdk/python/pulumi_azure/desktopvirtualization/workspace.py
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing im... | en | 0.65671 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The set of arguments for constructing a Workspace resource. :param pulumi.Input[str] resource_group_name: The name of the resour... | 1.984115 | 2 |
jupyanno/sheets.py | betatim/jupyanno | 23 | 1709 | <reponame>betatim/jupyanno
"""Code for reading and writing results to google sheets"""
from bs4 import BeautifulSoup
import requests
import warnings
import json
import pandas as pd
from six.moves.urllib.parse import urlparse, parse_qs
from six.moves.urllib.request import urlopen
_CELLSET_ID = "AIzaSyC8Zo-9EbXgHfqNzDxV... | """Code for reading and writing results to google sheets"""
from bs4 import BeautifulSoup
import requests
import warnings
import json
import pandas as pd
from six.moves.urllib.parse import urlparse, parse_qs
from six.moves.urllib.request import urlopen
_CELLSET_ID = "AIzaSyC8Zo-9EbXgHfqNzDxVb_YS_IIZBWtvoJ4"
def get_... | en | 0.822173 | Code for reading and writing results to google sheets Gets the sheet as a list of Dicts (directly importable to Pandas) :return: # TODO: we should probably get the whole sheet | 3.192674 | 3 |
sorting/python/max_heap.py | zhou7rui/algorithm | 6 | 1710 | # -*- coding: utf-8 -*
'''
最大堆实现
98
/ \
96 84
/ \ / \
92 82 78 47
/ \ / \ / \ / \
... | # -*- coding: utf-8 -*
'''
最大堆实现
98
/ \
96 84
/ \ / \
92 82 78 47
/ \ / \ / \ / \
... | en | 0.18569 | # -*- coding: utf-8 -* 最大堆实现 98 / \ 96 84 / \ / \ 92 82 78 47 / \ / \ / \ / \ 33 26 51 85 50 ... | 3.138951 | 3 |
ink2canvas/svg/Use.py | greipfrut/pdftohtml5canvas | 4 | 1711 | from ink2canvas.svg.AbstractShape import AbstractShape
class Use(AbstractShape):
def drawClone(self):
drawables = self.rootTree.getDrawable()
OriginName = self.getCloneId()
OriginObject = self.rootTree.searchElementById(OriginName,drawables)
OriginObject.runDraw()
de... | from ink2canvas.svg.AbstractShape import AbstractShape
class Use(AbstractShape):
def drawClone(self):
drawables = self.rootTree.getDrawable()
OriginName = self.getCloneId()
OriginObject = self.rootTree.searchElementById(OriginName,drawables)
OriginObject.runDraw()
de... | none | 1 | 2.803688 | 3 | |
docs/source/tutorial/code/read_csv.py | HanSooLim/DIL-Project | 2 | 1712 | <filename>docs/source/tutorial/code/read_csv.py
import pandas
datas = pandas.read_csv("../../Sample/example_dataset.csv", index_col=0)
print(datas)
| <filename>docs/source/tutorial/code/read_csv.py
import pandas
datas = pandas.read_csv("../../Sample/example_dataset.csv", index_col=0)
print(datas)
| none | 1 | 3.125736 | 3 | |
app.py | rghose/lol3 | 0 | 1713 | <filename>app.py<gh_stars>0
from flask import *
app = Flask(__name__)
import botty
# ----------------------------------
@app.route("/", methods=['GET', 'POST'])
def hello():
if request.method == 'POST':
data = request.form["query"]
return render_template("index.html",data=data)
return ren... | <filename>app.py<gh_stars>0
from flask import *
app = Flask(__name__)
import botty
# ----------------------------------
@app.route("/", methods=['GET', 'POST'])
def hello():
if request.method == 'POST':
data = request.form["query"]
return render_template("index.html",data=data)
return ren... | en | 0.123451 | # ---------------------------------- # ----------------------------------- # ----------------------------------- # ----------------------------------- | 2.584758 | 3 |
config.py | metarom-quality/gooseberry | 0 | 1714 | <filename>config.py<gh_stars>0
#!/usr/bin/env python3
import os
DATABASE="/home/tomate/Warehouse/syte/meta.db"
XLSDIR = "/mnt/c/Users/Natacha/Documents/TempDocs/progen/Formula/"
temp = [i for i in next(os.walk(XLSDIR))[2] if i.endswith("xlsx") or i.endswith("xls")]
flist = {}
for i in temp:
name = i.split(" ")[... | <filename>config.py<gh_stars>0
#!/usr/bin/env python3
import os
DATABASE="/home/tomate/Warehouse/syte/meta.db"
XLSDIR = "/mnt/c/Users/Natacha/Documents/TempDocs/progen/Formula/"
temp = [i for i in next(os.walk(XLSDIR))[2] if i.endswith("xlsx") or i.endswith("xls")]
flist = {}
for i in temp:
name = i.split(" ")[... | fr | 0.221828 | #!/usr/bin/env python3 | 2.272284 | 2 |
setup.py | markostrajkov/range-requests-proxy | 1 | 1715 | <gh_stars>1-10
#!/usr/bin/env python
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
... | #!/usr/bin/env python
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.py... | ru | 0.26433 | #!/usr/bin/env python | 1.99284 | 2 |
tests/pytorch_pfn_extras_tests/onnx/test_load_model.py | kmaehashi/pytorch-pfn-extras | 243 | 1716 | <reponame>kmaehashi/pytorch-pfn-extras<gh_stars>100-1000
import os
import pytest
import torch
import pytorch_pfn_extras.onnx as tou
from tests.pytorch_pfn_extras_tests.onnx.test_export_testcase import Net
@pytest.mark.filterwarnings("ignore:Named tensors .* experimental:UserWarning")
def test_onnx_load_model():
... | import os
import pytest
import torch
import pytorch_pfn_extras.onnx as tou
from tests.pytorch_pfn_extras_tests.onnx.test_export_testcase import Net
@pytest.mark.filterwarnings("ignore:Named tensors .* experimental:UserWarning")
def test_onnx_load_model():
model = Net()
outdir = "out/load_model_test"
tou... | none | 1 | 2.239379 | 2 | |
validate/v1/base.py | huzidabanzhang/Python | 4 | 1717 | <reponame>huzidabanzhang/Python<gh_stars>1-10
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
'''
@Description: 数据库验证器
@Author: Zpp
@Date: 2020-05-28 13:44:29
@LastEditors: Zpp
@LastEditTime: 2020-05-28 14:02:02
'''
params = {
# 验证字段
'fields': {
'type': {
'name': '导出类型',
'type': 'i... | #!/usr/bin/env python
# -*- coding:UTF-8 -*-
'''
@Description: 数据库验证器
@Author: Zpp
@Date: 2020-05-28 13:44:29
@LastEditors: Zpp
@LastEditTime: 2020-05-28 14:02:02
'''
params = {
# 验证字段
'fields': {
'type': {
'name': '导出类型',
'type': 'int',
'between': [1, 2, 3],
... | zh | 0.346874 | #!/usr/bin/env python # -*- coding:UTF-8 -*- @Description: 数据库验证器 @Author: Zpp @Date: 2020-05-28 13:44:29 @LastEditors: Zpp @LastEditTime: 2020-05-28 14:02:02 # 验证字段 # 导出数据库 # 导入数据库 # 首页登录清空 | 1.58071 | 2 |
example/speech_recognition/stt_layer_slice.py | axbaretto/mxnet | 92 | 1718 | import mxnet as mx
def slice_symbol_to_seq_symobls(net, seq_len, axis=1, squeeze_axis=True):
net = mx.sym.SliceChannel(data=net, num_outputs=seq_len, axis=axis, squeeze_axis=squeeze_axis)
hidden_all = []
for seq_index in range(seq_len):
hidden_all.append(net[seq_index])
net = hidden_all
re... | import mxnet as mx
def slice_symbol_to_seq_symobls(net, seq_len, axis=1, squeeze_axis=True):
net = mx.sym.SliceChannel(data=net, num_outputs=seq_len, axis=axis, squeeze_axis=squeeze_axis)
hidden_all = []
for seq_index in range(seq_len):
hidden_all.append(net[seq_index])
net = hidden_all
re... | none | 1 | 2.364905 | 2 | |
api/auth.py | fergalmoran/dss.api | 0 | 1719 | import datetime
import json
from calendar import timegm
from urllib.parse import parse_qsl
import requests
from allauth.socialaccount import models as aamodels
from requests_oauthlib import OAuth1
from rest_framework import parsers, renderers
from rest_framework import status
from rest_framework.authtoken.models impor... | import datetime
import json
from calendar import timegm
from urllib.parse import parse_qsl
import requests
from allauth.socialaccount import models as aamodels
from requests_oauthlib import OAuth1
from rest_framework import parsers, renderers
from rest_framework import status
from rest_framework.authtoken.models impor... | en | 0.646383 | Do some magic here to find user account and deprecate psa 1. Look for account in # try allauth # we got an allauth, create the SocialAccountLink View to authenticate users through social media. # Step 1. Exchange authorization code for access token. # Step 2. Retrieve information about the current user. # Step ... | 2.251101 | 2 |
bcgs/disqus_objects.py | aeturnum/bcgs | 0 | 1720 | import requests
import aiohttp
from constants import API_KEY
class User(object):
def __init__(self, author_info):
# "author": {
# "about": "",
# "avatar": {
# "cache": "//a.disquscdn.com/1519942534/images/noavatar92.png",
# ... | import requests
import aiohttp
from constants import API_KEY
class User(object):
def __init__(self, author_info):
# "author": {
# "about": "",
# "avatar": {
# "cache": "//a.disquscdn.com/1519942534/images/noavatar92.png",
# ... | en | 0.406788 | # "author": { # "about": "", # "avatar": { # "cache": "//a.disquscdn.com/1519942534/images/noavatar92.png", # "isCustom": false, # "large": { # "cache": "//a.disquscdn.com/1519942534/images/noavatar92.png", # "permalink": "https://dis... | 2.455447 | 2 |
nvdbgeotricks.py | LtGlahn/estimat_gulstripe | 0 | 1721 | <gh_stars>0
"""
En samling hjelpefunksjoner som bruker nvdbapiv3-funksjonene til å gjøre nyttige ting, f.eks. lagre geografiske datasett
Disse hjelpefunksjonene forutsetter fungerende installasjon av geopandas, shapely og en del andre ting som må
installeres separat. Noen av disse bibliotekene kunne historisk av og t... | """
En samling hjelpefunksjoner som bruker nvdbapiv3-funksjonene til å gjøre nyttige ting, f.eks. lagre geografiske datasett
Disse hjelpefunksjonene forutsetter fungerende installasjon av geopandas, shapely og en del andre ting som må
installeres separat. Noen av disse bibliotekene kunne historisk av og til være plun... | no | 0.754038 | En samling hjelpefunksjoner som bruker nvdbapiv3-funksjonene til å gjøre nyttige ting, f.eks. lagre geografiske datasett Disse hjelpefunksjonene forutsetter fungerende installasjon av geopandas, shapely og en del andre ting som må installeres separat. Noen av disse bibliotekene kunne historisk av og til være plundret... | 2.362172 | 2 |
019_CountingSundays.py | joetache4/project-euler | 0 | 1722 | """
You are given the following information, but you may prefer to do some research for yourself.
1 Jan 1900 was a Monday.
Thirty days has September,
April, June and November.
All the rest have thirty-one,
Saving February alone,
Which has twenty-eight, rain or shine.
And on leap years, twen... | """
You are given the following information, but you may prefer to do some research for yourself.
1 Jan 1900 was a Monday.
Thirty days has September,
April, June and November.
All the rest have thirty-one,
Saving February alone,
Which has twenty-eight, rain or shine.
And on leap years, twen... | en | 0.971768 | You are given the following information, but you may prefer to do some research for yourself. 1 Jan 1900 was a Monday. Thirty days has September, April, June and November. All the rest have thirty-one, Saving February alone, Which has twenty-eight, rain or shine. And on leap years, twenty-n... | 3.993675 | 4 |
setup.py | aagaard/dbservice | 1 | 1723 | <filename>setup.py
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
Setup for the dbservice
"""
from setuptools import setup, find_packages
setup(
name='dbservice',
version='0.9',
description="Database service for storing meter data",
author="<NAME>",
author_email='<EMAIL>',
url='https://... | <filename>setup.py
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
Setup for the dbservice
"""
from setuptools import setup, find_packages
setup(
name='dbservice',
version='0.9',
description="Database service for storing meter data",
author="<NAME>",
author_email='<EMAIL>',
url='https://... | en | 0.444895 | #!/usr/bin/env python3 # -*- encoding: utf-8 -*- Setup for the dbservice | 1.27583 | 1 |
venv/lib/python3.6/site-packages/ansible_collections/junipernetworks/junos/plugins/module_utils/network/junos/argspec/facts/facts.py | usegalaxy-no/usegalaxy | 1 | 1724 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The arg spec for the junos facts module.
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class FactsArgs(object):
""" The... | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The arg spec for the junos facts module.
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class FactsArgs(object):
""" The... | en | 0.471242 | # # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) The arg spec for the junos facts module. The arg spec for the junos facts module | 1.959034 | 2 |
server/dbcls/api/resources/authenticate.py | ripry/umakaviewer | 2 | 1725 | from flask_restful import Resource, reqparse
from firebase_admin import auth as firebase_auth
from dbcls.models import User
parser = reqparse.RequestParser()
parser.add_argument('token', type=str, required=True, nullable=False)
class Authenticate(Resource):
def post(self):
try:
args = parse... | from flask_restful import Resource, reqparse
from firebase_admin import auth as firebase_auth
from dbcls.models import User
parser = reqparse.RequestParser()
parser.add_argument('token', type=str, required=True, nullable=False)
class Authenticate(Resource):
def post(self):
try:
args = parse... | none | 1 | 2.671341 | 3 | |
GetJSONData_NLPParser.py | Feiyi-Ding/2021A | 0 | 1726 | <reponame>Feiyi-Ding/2021A
#Import required modules
import requests
import json
# Get json results for the required input
InputString = "kobe is a basketball player"
headers = {
'Content-type': 'application/json',
}
data = '{"text":InputString = '+ InputString + '}'
response = requests.post('htt... | #Import required modules
import requests
import json
# Get json results for the required input
InputString = "kobe is a basketball player"
headers = {
'Content-type': 'application/json',
}
data = '{"text":InputString = '+ InputString + '}'
response = requests.post('http://66.76.242.198:9888/', d... | en | 0.475345 | #Import required modules # Get json results for the required input #Adding a test comment to check if the automatic git pull is working or not #print(json.dumps(response, indent=4, sort_keys=True)) | 3.133015 | 3 |
language/bert_extraction/steal_bert_classifier/utils/wiki103_sentencize.py | Xtuden-com/language | 1,199 | 1727 | <filename>language/bert_extraction/steal_bert_classifier/utils/wiki103_sentencize.py<gh_stars>1000+
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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... | <filename>language/bert_extraction/steal_bert_classifier/utils/wiki103_sentencize.py<gh_stars>1000+
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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... | en | 0.81122 | # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ... | 2.397734 | 2 |
example_bots/any_to_any/__init__.py | budacom/trading-bots | 21 | 1728 | default_bot = 'example_bots.any_to_any.bot.AnyToAny'
| default_bot = 'example_bots.any_to_any.bot.AnyToAny'
| none | 1 | 1.182438 | 1 | |
helpers.py | owenjones/CaBot | 3 | 1729 | from server import roles
def hasRole(member, roleID):
role = member.guild.get_role(roleID)
return role in member.roles
def gainedRole(before, after, roleID):
role = before.guild.get_role(roleID)
return (role not in before.roles) and (role in after.roles)
def isExplorer(ctx):
return hasRole(ctx... | from server import roles
def hasRole(member, roleID):
role = member.guild.get_role(roleID)
return role in member.roles
def gainedRole(before, after, roleID):
role = before.guild.get_role(roleID)
return (role not in before.roles) and (role in after.roles)
def isExplorer(ctx):
return hasRole(ctx... | none | 1 | 2.661112 | 3 | |
databuilder/loader/file_system_neo4j_csv_loader.py | davcamer/amundsendatabuilder | 0 | 1730 | import csv
import logging
import os
import shutil
from csv import DictWriter # noqa: F401
from pyhocon import ConfigTree, ConfigFactory # noqa: F401
from typing import Dict, Any # noqa: F401
from databuilder.job.base_job import Job
from databuilder.loader.base_loader import Loader
from databuilder.models.neo4j_csv... | import csv
import logging
import os
import shutil
from csv import DictWriter # noqa: F401
from pyhocon import ConfigTree, ConfigFactory # noqa: F401
from typing import Dict, Any # noqa: F401
from databuilder.job.base_job import Job
from databuilder.loader.base_loader import Loader
from databuilder.models.neo4j_csv... | en | 0.812858 | # noqa: F401 # noqa: F401 # noqa: F401 # noqa: F401 Write node and relationship CSV file(s) that can be consumed by Neo4jCsvPublisher. It assumes that the record it consumes is instance of Neo4jCsvSerializable # Config keys # type: () -> None # type: Dict[Any, DictWriter] # type: Dict[Any, DictWriter] # type: (... | 2.303175 | 2 |
sample_program_04_02_knn.py | pepsinal/python_doe_kspub | 16 | 1731 | # -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import pandas as pd
from sklearn.neighbors import NearestNeighbors # k-NN
k_in_knn = 5 # k-NN における k
rate_of_training_samples_inside_ad = 0.96 # AD 内となるトレーニングデータの割合。AD のしきい値を決めるときに使用
dataset = pd.read_csv('resin.csv', index_col=0, header=0)
x_prediction ... | # -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import pandas as pd
from sklearn.neighbors import NearestNeighbors # k-NN
k_in_knn = 5 # k-NN における k
rate_of_training_samples_inside_ad = 0.96 # AD 内となるトレーニングデータの割合。AD のしきい値を決めるときに使用
dataset = pd.read_csv('resin.csv', index_col=0, header=0)
x_prediction ... | ja | 0.999904 | # -*- coding: utf-8 -*- @author: <NAME> # k-NN # k-NN における k # AD 内となるトレーニングデータの割合。AD のしきい値を決めるときに使用 # データ分割 # 目的変数 # 説明変数 # 標準偏差が 0 の特徴量の削除 # オートスケーリング # k-NN による AD # AD モデルの宣言 # k-NN による AD では、トレーニングデータの x を model_ad に格納することに対応 # サンプルごとの k 最近傍サンプルとの距離に加えて、k 最近傍サンプルのインデックス番号も一緒に出力されるため、出力用の変数を 2 つに # トレーニングデータでは k 最近... | 3.079659 | 3 |
topology.py | destinysky/nsh_sfc | 2 | 1732 | #!/usr/bin/python
"""
"""
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSKernelSwitch,UserSwitch
#OVSLegacyKernelSwitch, UserSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.link import Link, TCLink
#conf_port=50000
conf_ip_1='10.0.0.254'... | #!/usr/bin/python
"""
"""
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSKernelSwitch,UserSwitch
#OVSLegacyKernelSwitch, UserSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.link import Link, TCLink
#conf_port=50000
conf_ip_1='10.0.0.254'... | en | 0.41547 | #!/usr/bin/python #OVSLegacyKernelSwitch, UserSwitch #conf_port=50000 | 2.392479 | 2 |
lampara/lamp.py | gventuraagramonte/python | 0 | 1733 | <gh_stars>0
#Definicion de la clase
#antes de empezar una clase se declara de la siguiente manera
class Lamp:
_LAMPS = ['''
.
. | ,
\ ' /
` ,-. '
--- ( ) ---
\ /
_|=|_
|_____|
''',
'''
,-.
( )
\ /
_|=|_... | #Definicion de la clase
#antes de empezar una clase se declara de la siguiente manera
class Lamp:
_LAMPS = ['''
.
. | ,
\ ' /
` ,-. '
--- ( ) ---
\ /
_|=|_
|_____|
''',
'''
,-.
( )
\ /
_|=|_
|____... | es | 0.897926 | #Definicion de la clase #antes de empezar una clase se declara de la siguiente manera . . | , \ ' / ` ,-. ' --- ( ) --- \ / _|=|_ |_____| ,-. ( ) \ / _|=|_ |_____| #metodo instancia e init es el constructar osea es el primero qu... | 3.919849 | 4 |
lib/galaxy/model/migrate/versions/0084_add_ldda_id_to_implicit_conversion_table.py | sneumann/galaxy | 1 | 1734 | """
Migration script to add 'ldda_id' column to the implicitly_converted_dataset_association table.
"""
from __future__ import print_function
import logging
from sqlalchemy import (
Column,
ForeignKey,
Integer,
MetaData
)
from galaxy.model.migrate.versions.util import (
add_column,
drop_colum... | """
Migration script to add 'ldda_id' column to the implicitly_converted_dataset_association table.
"""
from __future__ import print_function
import logging
from sqlalchemy import (
Column,
ForeignKey,
Integer,
MetaData
)
from galaxy.model.migrate.versions.util import (
add_column,
drop_colum... | en | 0.574816 | Migration script to add 'ldda_id' column to the implicitly_converted_dataset_association table. # SQLAlchemy Migrate has a bug when adding a column with both a ForeignKey and a index in SQLite | 2.176913 | 2 |
ds.py | tobiichiorigami1/csp | 0 | 1735 | <gh_stars>0
votes_t_shape = [3, 0, 1, 2]
for i in range(6 - 4):
votes_t_shape += [i + 4]
print(votes_t_shape)
| votes_t_shape = [3, 0, 1, 2]
for i in range(6 - 4):
votes_t_shape += [i + 4]
print(votes_t_shape) | none | 1 | 2.795688 | 3 | |
scripts/adam/cc100_baselines.py | TimDettmers/sched | 1 | 1736 | <reponame>TimDettmers/sched<filename>scripts/adam/cc100_baselines.py
import numpy as np
import itertools
import gpuscheduler
import argparse
import os
import uuid
import hashlib
import glob
import math
from itertools import product
from torch.optim.lr_scheduler import OneCycleLR
from os.path import join
parser = argp... | import numpy as np
import itertools
import gpuscheduler
import argparse
import os
import uuid
import hashlib
import glob
import math
from itertools import product
from torch.optim.lr_scheduler import OneCycleLR
from os.path import join
parser = argparse.ArgumentParser(description='Compute script.')
parser.add_argumen... | en | 0.278218 | # 1024 tokens * 8 update_freq * 56250 steps = 0.4608e9 tokens -> optimal batch size 3460 # model sizes: 1.92bn, 2.43bn, 1.41bn #time_hours = 24*2 #partition = 'learnlab,learnfair,scavenge' #partition = 'learnfair' #partition = 'uninterruptible' #args2['lr-scheduler'] = 'cosine' #args2['warmup-updates'] = 3000 #args2['... | 1.80224 | 2 |
boa3_test/test_sc/event_test/EventNep5Transfer.py | hal0x2328/neo3-boa | 25 | 1737 | <filename>boa3_test/test_sc/event_test/EventNep5Transfer.py
from boa3.builtin import public
from boa3.builtin.contract import Nep5TransferEvent
transfer = Nep5TransferEvent
@public
def Main(from_addr: bytes, to_addr: bytes, amount: int):
transfer(from_addr, to_addr, amount)
| <filename>boa3_test/test_sc/event_test/EventNep5Transfer.py
from boa3.builtin import public
from boa3.builtin.contract import Nep5TransferEvent
transfer = Nep5TransferEvent
@public
def Main(from_addr: bytes, to_addr: bytes, amount: int):
transfer(from_addr, to_addr, amount)
| none | 1 | 1.451733 | 1 | |
abtest/views.py | SchuylerGoodman/topicalguide | 0 | 1738 | # The Topical Guide
# Copyright 2010-2011 Brigham Young University
#
# This file is part of the Topical Guide <http://nlp.cs.byu.edu/topic_browser>.
#
# The Topical Guide is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by the
# Free Soft... | # The Topical Guide
# Copyright 2010-2011 Brigham Young University
#
# This file is part of the Topical Guide <http://nlp.cs.byu.edu/topic_browser>.
#
# The Topical Guide is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by the
# Free Soft... | en | 0.849824 | # The Topical Guide # Copyright 2010-2011 Brigham Young University # # This file is part of the Topical Guide <http://nlp.cs.byu.edu/topic_browser>. # # The Topical Guide is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by the # Free Soft... | 2.256684 | 2 |
neurodocker/reprozip/tests/test_merge.py | sulantha2006/neurodocker | 0 | 1739 | """Tests for merge.py."""
from __future__ import absolute_import, division, print_function
from glob import glob
import os
import tarfile
import tempfile
from neurodocker.docker import client
from neurodocker.reprozip.trace import ReproZipMinimizer
from neurodocker.reprozip.merge import merge_pack_files
def _creat... | """Tests for merge.py."""
from __future__ import absolute_import, division, print_function
from glob import glob
import os
import tarfile
import tempfile
from neurodocker.docker import client
from neurodocker.reprozip.trace import ReproZipMinimizer
from neurodocker.reprozip.merge import merge_pack_files
def _creat... | en | 0.878794 | Tests for merge.py. Create packfile from list `commands` in debian:stretch container. | 2.022518 | 2 |
build/step-3-kivy-almost-manylinux/scripts/redirect_html5.py | dolang/build-kivy-linux | 0 | 1740 | """
HTML5 contexts.
:author: <NAME>
:license: MIT
"""
import contextlib
import io
import sys
__all__ = ['create_document', 'tag', 'as_link']
class create_document(contextlib.redirect_stdout):
"""Redirect output to an HTML5 document specified by new_target.
A HTML document title can ... | """
HTML5 contexts.
:author: <NAME>
:license: MIT
"""
import contextlib
import io
import sys
__all__ = ['create_document', 'tag', 'as_link']
class create_document(contextlib.redirect_stdout):
"""Redirect output to an HTML5 document specified by new_target.
A HTML document title can ... | en | 0.797814 | HTML5 contexts.
:author: <NAME>
:license: MIT Redirect output to an HTML5 document specified by new_target.
A HTML document title can be specified, but should not consist of
whitespace only. Default is a dash.
For serialisation, an encoding is included and defaults to UTF-8.
Make su... | 3.078558 | 3 |
lab/hw03-part-i_nov14.py | jzacsh/neuralnets-cmp464 | 1 | 1741 | <reponame>jzacsh/neuralnets-cmp464<gh_stars>1-10
"""
<NAME> solution to homework #3, Nov 14., Part I
"""
# Per homework instructions, following lead from matlab example by professor:
# http://comet.lehman.cuny.edu/schneider/Fall17/CMP464/Maple/PartialDerivatives1.pdf
import sys
import tensorflow as tf
import tempfile... | """
<NAME> solution to homework #3, Nov 14., Part I
"""
# Per homework instructions, following lead from matlab example by professor:
# http://comet.lehman.cuny.edu/schneider/Fall17/CMP464/Maple/PartialDerivatives1.pdf
import sys
import tensorflow as tf
import tempfile
import os
import numpy as np
os.environ['TF_CPP... | en | 0.804691 | <NAME> solution to homework #3, Nov 14., Part I # Per homework instructions, following lead from matlab example by professor: # http://comet.lehman.cuny.edu/schneider/Fall17/CMP464/Maple/PartialDerivatives1.pdf # not really doing intersting things in this lab, so just ignore optimization encapsulation of a function a... | 2.758035 | 3 |
modules/experiments_bc/set_tp.py | GChrysostomou/tasc | 2 | 1742 | import torch
import torch.nn as nn
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.metrics import *
from sklearn.metrics import precision_recall_fscore_support as prfs
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
d... | import torch
import torch.nn as nn
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.metrics import *
from sklearn.metrics import precision_recall_fscore_support as prfs
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
d... | none | 1 | 2.449912 | 2 | |
helios/tasks.py | mattmurch/helios-server | 0 | 1743 | <filename>helios/tasks.py
"""
Celery queued tasks for Helios
2010-08-01
<EMAIL>
"""
import copy
from celery import shared_task
from celery.utils.log import get_logger
import signals
from models import CastVote, Election, Voter, VoterFile
from view_utils import render_template_raw
@shared_task
def cast_vote_verify_a... | <filename>helios/tasks.py
"""
Celery queued tasks for Helios
2010-08-01
<EMAIL>
"""
import copy
from celery import shared_task
from celery.utils.log import get_logger
import signals
from models import CastVote, Election, Voter, VoterFile
from view_utils import render_template_raw
@shared_task
def cast_vote_verify_a... | en | 0.955592 | Celery queued tasks for Helios 2010-08-01 <EMAIL> # send the signal voter_constraints_include are conditions on including voters voter_constraints_exclude are conditions on excluding voters # select the right list of voters The encrypted tally for election %s has been computed. -- Helios Helios has decrypted its ... | 2.220037 | 2 |
tests/conftest.py | AlanRosenthal/virtual-dealer | 1 | 1744 | <reponame>AlanRosenthal/virtual-dealer<gh_stars>1-10
"""
pytest fixtures
"""
import unittest.mock as mock
import pytest
import virtual_dealer.api
@pytest.fixture(name="client")
def fixture_client():
"""
Client test fixture for testing flask APIs
"""
return virtual_dealer.api.app.test_client()
@pytes... | """
pytest fixtures
"""
import unittest.mock as mock
import pytest
import virtual_dealer.api
@pytest.fixture(name="client")
def fixture_client():
"""
Client test fixture for testing flask APIs
"""
return virtual_dealer.api.app.test_client()
@pytest.fixture(name="store")
def fixture_store():
"""
... | en | 0.465183 | pytest fixtures Client test fixture for testing flask APIs Mock for store::Store Client test fixture for testing Google's datastore APIs Datastore Key Mock Datastore Entity Mock | 2.71075 | 3 |
corehq/apps/fixtures/tests.py | dslowikowski/commcare-hq | 1 | 1745 | from xml.etree import ElementTree
from casexml.apps.case.tests.util import check_xml_line_by_line
from casexml.apps.case.xml import V2
from corehq.apps.fixtures import fixturegenerators
from corehq.apps.fixtures.models import FixtureDataItem, FixtureDataType, FixtureOwnership, FixtureTypeField, \
FixtureItemField, ... | from xml.etree import ElementTree
from casexml.apps.case.tests.util import check_xml_line_by_line
from casexml.apps.case.xml import V2
from corehq.apps.fixtures import fixturegenerators
from corehq.apps.fixtures.models import FixtureDataItem, FixtureDataType, FixtureOwnership, FixtureTypeField, \
FixtureItemField, ... | en | 0.324281 | <district> <state_name>Delhi_state</state_name> <district_name lang="hin">Delhi_in_HIN</district_name> <district_name lang="eng">Delhi_in_ENG</district_name> <district_id>Delhi_id</district_id> </district> <fixture id="item-list:district" user_id="%s"> ... | 1.95564 | 2 |
readthedocs/search/signals.py | agarwalrounak/readthedocs.org | 10 | 1746 | # -*- coding: utf-8 -*-
"""We define custom Django signals to trigger before executing searches."""
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
from django_elasticsearch_dsl.apps import DEDConfig
from readthedocs.projects.models import HTMLFile, Project
from readthe... | # -*- coding: utf-8 -*-
"""We define custom Django signals to trigger before executing searches."""
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
from django_elasticsearch_dsl.apps import DEDConfig
from readthedocs.projects.models import HTMLFile, Project
from readthe... | en | 0.867929 | # -*- coding: utf-8 -*- We define custom Django signals to trigger before executing searches. Handle indexing from the build process. # Do not index if autosync is disabled globally Remove deleted files from the build process. # Do not index if autosync is disabled globally Save a Project instance based on the post_sav... | 2.068379 | 2 |
src/falconpy/_endpoint/_filevantage.py | kra-ts/falconpy | 0 | 1747 | <reponame>kra-ts/falconpy
"""Internal API endpoint constant library.
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |... | """Internal API endpoint constant library.
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | ... | en | 0.754356 | Internal API endpoint constant library. _______ __ _______ __ __ __ | _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----. |. 1___| _| _ | | | | _ | 1___| _| _| | <| -__| |. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____| |: 1 | ... | 0.93688 | 1 |
TimeWrapper_JE/venv/Lib/site-packages/pip/_internal/cli/progress_bars.py | JE-Chen/je_old_repo | 0 | 1748 | import itertools
import sys
from signal import SIGINT, default_int_handler, signal
from typing import Any, Dict, List
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
from pip._vendor.progress.spinner import Spinner
from pip._internal.utils.compat import WINDOWS
from pip._internal.... | import itertools
import sys
from signal import SIGINT, default_int_handler, signal
from typing import Any, Dict, List
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
from pip._vendor.progress.spinner import Spinner
from pip._internal.utils.compat import WINDOWS
from pip._internal.... | en | 0.837739 | # Lots of different errors can come from this, including SystemError and # ImportError. # type: (Bar, Bar) -> Bar # If we don't know what encoding this file is in, then we'll just assume # that it doesn't support unicode and use the ASCII bar. # Collect all of the possible characters we want to use with the preferred #... | 2.089502 | 2 |
scripts/study_case/ID_5/matchzoo/auto/tuner/tune.py | kzbnb/numerical_bugs | 8 | 1749 | import typing
import numpy as np
import scripts.study_case.ID_5.matchzoo as mz
from scripts.study_case.ID_5.matchzoo.engine.base_metric import BaseMetric
from .tuner import Tuner
def tune(
params: 'mz.ParamTable',
optimizer: str = 'adam',
trainloader: mz.dataloader.DataLoader = None,
validloader: mz... | import typing
import numpy as np
import scripts.study_case.ID_5.matchzoo as mz
from scripts.study_case.ID_5.matchzoo.engine.base_metric import BaseMetric
from .tuner import Tuner
def tune(
params: 'mz.ParamTable',
optimizer: str = 'adam',
trainloader: mz.dataloader.DataLoader = None,
validloader: mz... | en | 0.425657 | Tune model hyper-parameters. A simple shorthand for using :class:`matchzoo.auto.Tuner`. `model.params.hyper_space` reprensents the model's hyper-parameters search space, which is the cross-product of individual hyper parameter's hyper space. When a `Tuner` builds a model, for each hyper parameter in ... | 2.770159 | 3 |
libs/gym/tests/wrappers/test_pixel_observation.py | maxgold/icml22 | 0 | 1750 | <reponame>maxgold/icml22
"""Tests for the pixel observation wrapper."""
from typing import Optional
import pytest
import numpy as np
import gym
from gym import spaces
from gym.wrappers.pixel_observation import PixelObservationWrapper, STATE_KEY
class FakeEnvironment(gym.Env):
def __init__(self):
self.ac... | """Tests for the pixel observation wrapper."""
from typing import Optional
import pytest
import numpy as np
import gym
from gym import spaces
from gym.wrappers.pixel_observation import PixelObservationWrapper, STATE_KEY
class FakeEnvironment(gym.Env):
def __init__(self):
self.action_space = spaces.Box(s... | en | 0.884131 | Tests for the pixel observation wrapper. # Make sure we are testing the right environment for the test. # The wrapper should only add one observation. # Check that the added space item is consistent with the added observation. | 2.270158 | 2 |
real_plot_fft_stft_impl.py | MuAuan/Scipy-Swan | 0 | 1751 | <reponame>MuAuan/Scipy-Swan<filename>real_plot_fft_stft_impl.py<gh_stars>0
import pyaudio
import wave
from scipy.fftpack import fft, ifft
import numpy as np
import matplotlib.pyplot as plt
import cv2
from scipy import signal
from swan import pycwt
CHUNK = 1024
FORMAT = pyaudio.paInt16 # int16型
CHANNELS = 1 ... | import pyaudio
import wave
from scipy.fftpack import fft, ifft
import numpy as np
import matplotlib.pyplot as plt
import cv2
from scipy import signal
from swan import pycwt
CHUNK = 1024
FORMAT = pyaudio.paInt16 # int16型
CHANNELS = 1 # 1;monoral 2;ステレオ-
RATE = 22100 # 22.1kHz 44.1kHz
RECORD_SECO... | ja | 0.42158 | # int16型 # 1;monoral 2;ステレオ- # 22.1kHz 44.1kHz # 5秒録音 # figureの初期化 #wr.getnchannels() #wr.getsampwidth() #wr.getframerate() | 2.354943 | 2 |
tests/pydecompile-test/baselines/events_in_code_blocks.py | gengxf0505/pxt | 1 | 1752 | #/ <reference path="./testBlocks/mb.ts" />
def function_0():
basic.showNumber(7)
basic.forever(function_0) | #/ <reference path="./testBlocks/mb.ts" />
def function_0():
basic.showNumber(7)
basic.forever(function_0) | en | 0.347352 | #/ <reference path="./testBlocks/mb.ts" /> | 1.312487 | 1 |
PID/PDControl.py | l756302098/ros_practice | 0 | 1753 | <filename>PID/PDControl.py
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import random
import numpy as np
import matplotlib.pyplot as plt
class Robot(object):
def __init__(self, length=20.0):
"""
Creates robotand initializes location/orientation to 0, 0, 0.
"""
self.x = 0.0
self.y ... | <filename>PID/PDControl.py
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import random
import numpy as np
import matplotlib.pyplot as plt
class Robot(object):
def __init__(self, length=20.0):
"""
Creates robotand initializes location/orientation to 0, 0, 0.
"""
self.x = 0.0
self.y ... | en | 0.654801 | #!/usr/bin/env python # -*- coding:utf-8 -*- Creates robotand initializes location/orientation to 0, 0, 0. Sets a robotcoordinate. Sets thenoise parameters. # makes itpossible to change the noise parameters # this isoften useful in particle filters Sets thesystematical steering drift parameter steering =front wheel ste... | 3.31422 | 3 |
torchvision/datasets/samplers/__init__.py | yoshitomo-matsubara/vision | 12,063 | 1754 | <gh_stars>1000+
from .clip_sampler import DistributedSampler, UniformClipSampler, RandomClipSampler
__all__ = ("DistributedSampler", "UniformClipSampler", "RandomClipSampler")
| from .clip_sampler import DistributedSampler, UniformClipSampler, RandomClipSampler
__all__ = ("DistributedSampler", "UniformClipSampler", "RandomClipSampler") | none | 1 | 1.075898 | 1 | |
Pyshare2019/02 - if + Nesteed if/Nesteed-IF.py | suhaili99/python-share | 4 | 1755 | name = input("masukkan nama pembeli = ")
alamat= input("Alamat = ")
NoTelp = input("No Telp = ")
print("\n")
print("=================INFORMASI HARGA MOBIL DEALER JAYA ABADI===============")
print("Pilih Jenis Mobil :")
print("\t 1.Daihatsu ")
print("\t 2.Honda ")
print("\t 3.Toyota ")
print("")
pilihan = int(input("Pil... | name = input("masukkan nama pembeli = ")
alamat= input("Alamat = ")
NoTelp = input("No Telp = ")
print("\n")
print("=================INFORMASI HARGA MOBIL DEALER JAYA ABADI===============")
print("Pilih Jenis Mobil :")
print("\t 1.Daihatsu ")
print("\t 2.Honda ")
print("\t 3.Toyota ")
print("")
pilihan = int(input("Pil... | none | 1 | 3.875496 | 4 | |
oneflow/python/test/ops/test_l1loss.py | wanghongsheng01/framework_enflame | 2 | 1756 | <gh_stars>1-10
"""
Copyright 2020 The OneFlow 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 applic... | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | en | 0.85788 | Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed ... | 2.151249 | 2 |
tests/test_schema.py | Dog-Egg/dida | 0 | 1757 | import unittest
import datetime
from dida import schemas, triggers
from marshmallow import ValidationError
class TestTriggerSchema(unittest.TestCase):
def test_dump_trigger(self):
result = schemas.TriggerSchema().dump(triggers.IntervalTrigger())
print('IntervalTrigger dump:', result)
res... | import unittest
import datetime
from dida import schemas, triggers
from marshmallow import ValidationError
class TestTriggerSchema(unittest.TestCase):
def test_dump_trigger(self):
result = schemas.TriggerSchema().dump(triggers.IntervalTrigger())
print('IntervalTrigger dump:', result)
res... | none | 1 | 2.62043 | 3 | |
apps/content/views.py | Sunbird-Ed/evolve-api | 1 | 1758 | <filename>apps/content/views.py
from django.shortcuts import render
from rest_framework import status
from rest_framework.generics import (
ListAPIView,
ListCreateAPIView,
ListAPIView,
RetrieveUpdateAPIView,)
from rest_framework.response import Response
from rest_framework.permissions import IsAuthentic... | <filename>apps/content/views.py
from django.shortcuts import render
from rest_framework import status
from rest_framework.generics import (
ListAPIView,
ListCreateAPIView,
ListAPIView,
RetrieveUpdateAPIView,)
from rest_framework.response import Response
from rest_framework.permissions import IsAuthentic... | ca | 0.071365 | # data_frame.to_excel(path + 'contentstatus.xlsx') # data_frame.to_excel(path + 'content_contributers.xlsx') | 1.573204 | 2 |
examples/given_data.py | GuoJingyao/cornac | 0 | 1759 | # -*- coding: utf-8 -*-
"""
Example to train and evaluate a model with given data
@author: <NAME> <<EMAIL>>
"""
from cornac.data import Reader
from cornac.eval_methods import BaseMethod
from cornac.models import MF
from cornac.metrics import MAE, RMSE
from cornac.utils import cache
# Download MovieLens 100K provide... | # -*- coding: utf-8 -*-
"""
Example to train and evaluate a model with given data
@author: <NAME> <<EMAIL>>
"""
from cornac.data import Reader
from cornac.eval_methods import BaseMethod
from cornac.models import MF
from cornac.metrics import MAE, RMSE
from cornac.utils import cache
# Download MovieLens 100K provide... | en | 0.685542 | # -*- coding: utf-8 -*- Example to train and evaluate a model with given data @author: <NAME> <<EMAIL>> # Download MovieLens 100K provided training and test splits # Evaluation | 3.275962 | 3 |
taming/data/ade20k.py | ZlodeiBaal/taming | 0 | 1760 | import os
import numpy as np
import cv2
import albumentations
from PIL import Image
from torch.utils.data import Dataset
from taming.data.sflckr import SegmentationBase # for examples included in repo
class Examples(SegmentationBase):
def __init__(self, size=256, random_crop=False, interpolation="bicubic"):
... | import os
import numpy as np
import cv2
import albumentations
from PIL import Image
from torch.utils.data import Dataset
from taming.data.sflckr import SegmentationBase # for examples included in repo
class Examples(SegmentationBase):
def __init__(self, size=256, random_crop=False, interpolation="bicubic"):
... | en | 0.782623 | # for examples included in repo # With semantic map and scene label # unknown + 150 # default to random_crop=True | 2.405146 | 2 |
templates/federated_reporting/distributed_cleanup.py | olehermanse/masterfiles | 44 | 1761 | #!/usr/bin/env python3
"""
fr_distributed_cleanup.py - a script to remove hosts which have migrated to
other feeder hubs. To be run on Federated Reporting superhub
after each import of feeder data.
First, to setup, enable fr_distributed_cleanup by setting a class in augments (def.json).
This enables policy in cfe_inte... | #!/usr/bin/env python3
"""
fr_distributed_cleanup.py - a script to remove hosts which have migrated to
other feeder hubs. To be run on Federated Reporting superhub
after each import of feeder data.
First, to setup, enable fr_distributed_cleanup by setting a class in augments (def.json).
This enables policy in cfe_inte... | en | 0.845087 | #!/usr/bin/env python3 fr_distributed_cleanup.py - a script to remove hosts which have migrated to other feeder hubs. To be run on Federated Reporting superhub after each import of feeder data. First, to setup, enable fr_distributed_cleanup by setting a class in augments (def.json). This enables policy in cfe_internal... | 2.054773 | 2 |
Python/Fibonacci.py | kennethsequeira/Hello-world | 1 | 1762 | #Doesn't work.
import time
fibonacci = [1, 1]
n = int(input())
while len(fibonacci) < n:
fibonacci.append(fibonacci[-1] + fibonacci[-2])
for i in range(n):
print(fibonacci[i], end=' ')
| #Doesn't work.
import time
fibonacci = [1, 1]
n = int(input())
while len(fibonacci) < n:
fibonacci.append(fibonacci[-1] + fibonacci[-2])
for i in range(n):
print(fibonacci[i], end=' ')
| en | 0.997308 | #Doesn't work. | 3.744214 | 4 |
setup.py | kreyoo/csgo-inv-shuffle | 0 | 1763 | <reponame>kreyoo/csgo-inv-shuffle
from setuptools import setup
setup(name="csgoinvshuffle")
| from setuptools import setup
setup(name="csgoinvshuffle") | none | 1 | 1.018737 | 1 | |
py/_log/log.py | EnjoyLifeFund/py36pkgs | 2 | 1764 | <filename>py/_log/log.py
"""
basic logging functionality based on a producer/consumer scheme.
XXX implement this API: (maybe put it into slogger.py?)
log = Logger(
info=py.log.STDOUT,
debug=py.log.STDOUT,
command=None)
log.info("hell... | <filename>py/_log/log.py
"""
basic logging functionality based on a producer/consumer scheme.
XXX implement this API: (maybe put it into slogger.py?)
log = Logger(
info=py.log.STDOUT,
debug=py.log.STDOUT,
command=None)
log.info("hell... | en | 0.780955 | basic logging functionality based on a producer/consumer scheme.
XXX implement this API: (maybe put it into slogger.py?)
log = Logger(
info=py.log.STDOUT,
debug=py.log.STDOUT,
command=None)
log.info("hello", "world")
log.comm... | 2.942061 | 3 |
test/test_all_contacts.py | Sergggio/python_training | 0 | 1765 | import re
from model.contact import Contact
def test_all_contacts(app, db):
contacts_from_db = db.get_contact_list()
phone_list_from_db = db.phones_from_db()
#email_liset_from_db = db.emails_from_db()
phone_list = []
for phone in phone_list_from_db:
phone_list.append(merge_phones_like_on_h... | import re
from model.contact import Contact
def test_all_contacts(app, db):
contacts_from_db = db.get_contact_list()
phone_list_from_db = db.phones_from_db()
#email_liset_from_db = db.emails_from_db()
phone_list = []
for phone in phone_list_from_db:
phone_list.append(merge_phones_like_on_h... | en | 0.269718 | #email_liset_from_db = db.emails_from_db() #for email in email_liset_from_db: # email_list.append(merge_mail_like_on_home_page(email)) #emails_from_home_page = [con.all_mail_from_home_page for con in contacts_from_home_page] #assert email_list == emails_from_home_page | 2.609317 | 3 |
samples/abp/test_graphics.py | jproudlo/PyModel | 61 | 1766 | <gh_stars>10-100
"""
ABP analyzer and graphics tests
"""
cases = [
('Run Pymodel Graphics to generate dot file from FSM model, no need use pma',
'pmg ABP'),
('Generate SVG file from dot',
'dotsvg ABP'),
# Now display ABP.dot in browser
('Run PyModel Analyzer to generate FSM from original F... | """
ABP analyzer and graphics tests
"""
cases = [
('Run Pymodel Graphics to generate dot file from FSM model, no need use pma',
'pmg ABP'),
('Generate SVG file from dot',
'dotsvg ABP'),
# Now display ABP.dot in browser
('Run PyModel Analyzer to generate FSM from original FSM, should be the... | en | 0.690725 | ABP analyzer and graphics tests # Now display ABP.dot in browser # Now display ABPFSM.svg in browser, should look the same as ABP.svg | 2.113077 | 2 |
games/migrations/0002_auto_20201026_1221.py | IceArrow256/game-list | 3 | 1767 | <filename>games/migrations/0002_auto_20201026_1221.py
# Generated by Django 3.1.2 on 2020-10-26 12:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('games', '0001_initial'),
]
operations = [
migrations.... | <filename>games/migrations/0002_auto_20201026_1221.py
# Generated by Django 3.1.2 on 2020-10-26 12:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('games', '0001_initial'),
]
operations = [
migrations.... | en | 0.790069 | # Generated by Django 3.1.2 on 2020-10-26 12:21 | 1.571603 | 2 |
build/lib.linux-x86_64-2.7_ucs4/mx/Misc/PackageTools.py | mkubux/egenix-mx-base | 0 | 1768 | """ PackageTools - A set of tools to aid working with packages.
Copyright (c) 1998-2000, <NAME>; mailto:<EMAIL>
Copyright (c) 2000-2015, eGenix.com Software GmbH; mailto:<EMAIL>
See the documentation for further information on copyrights,
or contact the author. All Rights Reserved.
"""
__version__ = '0... | """ PackageTools - A set of tools to aid working with packages.
Copyright (c) 1998-2000, <NAME>; mailto:<EMAIL>
Copyright (c) 2000-2015, eGenix.com Software GmbH; mailto:<EMAIL>
See the documentation for further information on copyrights,
or contact the author. All Rights Reserved.
"""
__version__ = '0... | en | 0.761852 | PackageTools - A set of tools to aid working with packages. Copyright (c) 1998-2000, <NAME>; mailto:<EMAIL> Copyright (c) 2000-2015, eGenix.com Software GmbH; mailto:<EMAIL> See the documentation for further information on copyrights, or contact the author. All Rights Reserved. # RE to identify Python ... | 2.244955 | 2 |
Lib/test/test_urllib.py | Kshitijkrishnadas/haribol | 4 | 1769 | <filename>Lib/test/test_urllib.py
"""Regression tests for what was in Python 2's "urllib" module"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from unittest.mock import patch
from test import support
import os
try:
import ssl
exce... | <filename>Lib/test/test_urllib.py
"""Regression tests for what was in Python 2's "urllib" module"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from unittest.mock import patch
from test import support
import os
try:
import ssl
exce... | en | 0.734995 | Regression tests for what was in Python 2's "urllib" module Escape char as RFC 2396 specifies # Shortcut for testing FancyURLopener urlopen(url [, data]) -> open file-like object # buffer to store data for verification in urlopen tests. # bpo-36918: HTTPConnection destructor calls close() which calls # flush(). Problem... | 2.823354 | 3 |
gapipy/resources/tour/transport.py | wmak/gapipy | 0 | 1770 | # Python 2 and 3
from __future__ import unicode_literals
from ...models import Address, SeasonalPriceBand
from ..base import Product
class Transport(Product):
_resource_name = 'transports'
_is_listable = False
_as_is_fields = [
'id', 'href', 'availability', 'name', 'product_line', 'sku', 'type... | # Python 2 and 3
from __future__ import unicode_literals
from ...models import Address, SeasonalPriceBand
from ..base import Product
class Transport(Product):
_resource_name = 'transports'
_is_listable = False
_as_is_fields = [
'id', 'href', 'availability', 'name', 'product_line', 'sku', 'type... | en | 0.707708 | # Python 2 and 3 | 1.837465 | 2 |
modules/dare.py | VeNoM-hubs/nyx | 0 | 1771 | from discord.ext import commands
import json
import random
with open("assets/json/questions.json") as data:
data = json.load(data)
dares = data["dares"]
class Dare(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(aliases=["d"])
async def dare(self, ctx):... | from discord.ext import commands
import json
import random
with open("assets/json/questions.json") as data:
data = json.load(data)
dares = data["dares"]
class Dare(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(aliases=["d"])
async def dare(self, ctx):... | none | 1 | 2.742584 | 3 | |
scripts/apic.py | nicmatth/APIC-EM-HelloWorldv3 | 0 | 1772 | <filename>scripts/apic.py
APIC_IP="sandboxapic.cisco.com"
APIC_PORT="443"
GROUP='group-xx'
| <filename>scripts/apic.py
APIC_IP="sandboxapic.cisco.com"
APIC_PORT="443"
GROUP='group-xx'
| none | 1 | 1.309976 | 1 | |
stella/test/external_func.py | squisher/stella | 11 | 1773 | <reponame>squisher/stella
# Copyright 2013-2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | # Copyright 2013-2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | en | 0.840996 | # Copyright 2013-2015 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ... | 2.481829 | 2 |
szh_objects.py | ipqhjjybj/bitcoin_trend_strategy | 4 | 1774 | <gh_stars>1-10
# encoding: utf-8
import sys
from market_maker import OrderManager
from settings import *
import os
from pymongo import MongoClient, ASCENDING
from pymongo.errors import ConnectionFailure
from datetime import datetime , timedelta
import numpy as np
#################################################... | # encoding: utf-8
import sys
from market_maker import OrderManager
from settings import *
import os
from pymongo import MongoClient, ASCENDING
from pymongo.errors import ConnectionFailure
from datetime import datetime , timedelta
import numpy as np
################################################################... | zh | 0.544734 | # encoding: utf-8 ######################################################################################################################## # constants #---------------------------------------------------------------------- #---------------------------------------------------------------------- #------------------------... | 2.03748 | 2 |
CodeAnalysis/SourceMeter_Interface/SourceMeter-8.2.0-x64-linux/Python/Tools/python/pylint/pyreverse/writer.py | ishtjot/susereumutep | 14,668 | 1775 | # -*- coding: utf-8 -*-
# Copyright (c) 2008-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:<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 t... | # -*- coding: utf-8 -*-
# Copyright (c) 2008-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:<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 t... | en | 0.801621 | # -*- coding: utf-8 -*- # Copyright (c) 2008-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:<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 t... | 1.957062 | 2 |
graphql-ml-serving/backend/mutations.py | philippe-heitzmann/python-apps | 13 | 1776 | import logging
from ariadne import MutationType, convert_kwargs_to_snake_case
from config import clients, messages, queue
mutation = MutationType()
@mutation.field("createMessage")
@convert_kwargs_to_snake_case
async def resolve_create_message(obj, info, content, client_id):
try:
message = {"content": co... | import logging
from ariadne import MutationType, convert_kwargs_to_snake_case
from config import clients, messages, queue
mutation = MutationType()
@mutation.field("createMessage")
@convert_kwargs_to_snake_case
async def resolve_create_message(obj, info, content, client_id):
try:
message = {"content": co... | none | 1 | 2.165129 | 2 | |
hc/api/transports.py | MaxwellDPS/healthchecks | 1 | 1777 | <reponame>MaxwellDPS/healthchecks
import os
from django.conf import settings
from django.template.loader import render_to_string
from django.utils import timezone
import json
import requests
from urllib.parse import quote, urlencode
from hc.accounts.models import Profile
from hc.lib import emails
from hc.lib.string i... | import os
from django.conf import settings
from django.template.loader import render_to_string
from django.utils import timezone
import json
import requests
from urllib.parse import quote, urlencode
from hc.accounts.models import Profile
from hc.lib import emails
from hc.lib.string import replace
try:
import app... | en | 0.778975 | # Enforce # \xa0 is non-breaking space. It causes SMS messages to use UCS2 encoding # and cost twice the money. Send notification about current status of the check. This method returns None on success, and error message on error. Return True if transport will ignore check's current status. Thi... | 2.086646 | 2 |
graviti/portex/builder.py | Graviti-AI/graviti-python-sdk | 12 | 1778 | <gh_stars>10-100
#!/usr/bin/env python3
#
# Copyright 2022 Graviti. Licensed under MIT License.
#
"""Portex type builder related classes."""
from hashlib import md5
from pathlib import Path
from shutil import rmtree
from subprocess import PIPE, CalledProcessError, run
from tempfile import gettempdir
from typing impor... | #!/usr/bin/env python3
#
# Copyright 2022 Graviti. Licensed under MIT License.
#
"""Portex type builder related classes."""
from hashlib import md5
from pathlib import Path
from shutil import rmtree
from subprocess import PIPE, CalledProcessError, run
from tempfile import gettempdir
from typing import TYPE_CHECKING, ... | en | 0.585717 | #!/usr/bin/env python3 # # Copyright 2022 Graviti. Licensed under MIT License. # Portex type builder related classes. The local git repo of the external Portex package. Arguments: url: The git repo url of the external package. revision: The git repo revision (tag/commit) of the external package. # ... | 2.077198 | 2 |
dffml/operation/mapping.py | SGeetansh/dffml | 171 | 1779 | from typing import Dict, List, Any
from ..df.types import Definition
from ..df.base import op
from ..util.data import traverse_get
MAPPING = Definition(name="mapping", primitive="map")
MAPPING_TRAVERSE = Definition(name="mapping_traverse", primitive="List[str]")
MAPPING_KEY = Definition(name="key", primitive="str")
M... | from typing import Dict, List, Any
from ..df.types import Definition
from ..df.base import op
from ..util.data import traverse_get
MAPPING = Definition(name="mapping", primitive="map")
MAPPING_TRAVERSE = Definition(name="mapping_traverse", primitive="List[str]")
MAPPING_KEY = Definition(name="key", primitive="str")
M... | en | 0.358913 | Extracts value from a given mapping. Parameters ---------- mapping : dict The mapping to extract the value from. traverse : list[str] A list of keys to traverse through the mapping dictionary and extract the values. Returns ------- dict A dictionary containing the v... | 2.712556 | 3 |
anchore_engine/services/policy_engine/__init__.py | Vijay-P/anchore-engine | 0 | 1780 | import time
import sys
import pkg_resources
import os
import retrying
from sqlalchemy.exc import IntegrityError
# anchore modules
import anchore_engine.clients.services.common
import anchore_engine.subsys.servicestatus
import anchore_engine.subsys.metrics
from anchore_engine.subsys import logger
from anchore_engine.c... | import time
import sys
import pkg_resources
import os
import retrying
from sqlalchemy.exc import IntegrityError
# anchore modules
import anchore_engine.clients.services.common
import anchore_engine.subsys.servicestatus
import anchore_engine.subsys.metrics
from anchore_engine.subsys import logger
from anchore_engine.c... | en | 0.747434 | # anchore modules # from anchore_engine.subsys.logger import enable_bootstrap_logging # enable_bootstrap_logging() # These are user-configurable but mostly for debugging and testing purposes # service funcs (must be here) Execute the preflight functions, aborting service startup if any throw uncaught exceptions or retu... | 1.974127 | 2 |
juriscraper/oral_args/united_states/federal_appellate/scotus.py | EvandoBlanco/juriscraper | 228 | 1781 | <reponame>EvandoBlanco/juriscraper<filename>juriscraper/oral_args/united_states/federal_appellate/scotus.py<gh_stars>100-1000
"""Scraper for Supreme Court of U.S.
CourtID: scotus
Court Short Name: scotus
History:
- 2014-07-20 - Created by <NAME>, reviewed by MLR
- 2017-10-09 - Updated by MLR.
"""
from datetime impor... | """Scraper for Supreme Court of U.S.
CourtID: scotus
Court Short Name: scotus
History:
- 2014-07-20 - Created by <NAME>, reviewed by MLR
- 2017-10-09 - Updated by MLR.
"""
from datetime import datetime
from juriscraper.OralArgumentSite import OralArgumentSite
class Site(OralArgumentSite):
def __init__(self, *... | en | 0.937153 | Scraper for Supreme Court of U.S. CourtID: scotus Court Short Name: scotus History: - 2014-07-20 - Created by <NAME>, reviewed by MLR - 2017-10-09 - Updated by MLR. # or 'wma' is also available for any case. | 2.714619 | 3 |
code/main.py | pengzhansun/CF-CAR | 8 | 1782 | # -*- coding: utf-8 -*-
import argparse
import os
import shutil
import time
import numpy as np
import random
from collections import OrderedDict
import torch
import torch.backends.cudnn as cudnn
from callbacks import AverageMeter
from data_utils.causal_data_loader_frames import VideoFolder
from utils impo... | # -*- coding: utf-8 -*-
import argparse
import os
import shutil
import time
import numpy as np
import random
from collections import OrderedDict
import torch
import torch.backends.cudnn as cudnn
from callbacks import AverageMeter
from data_utils.causal_data_loader_frames import VideoFolder
from utils impo... | en | 0.773553 | # -*- coding: utf-8 -*- # Path, dataset and log related arguments # model, image&feature dim and training related arguments # train mode, hardware setting and others related arguments # create vision model # create coord model # create fusion model # load model branch # create the fusion function for the activation of ... | 1.966511 | 2 |
api/application/__init__.py | 114000/webapp-boilerplate | 0 | 1783 | # encoding: utf-8
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
import logging
app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})
app.config.from_object('config.current')
db = SQLAlchemy(app)
logger = logging.getLogger(__name__)
log... | # encoding: utf-8
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
import logging
app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})
app.config.from_object('config.current')
db = SQLAlchemy(app)
logger = logging.getLogger(__name__)
log... | en | 0.867799 | # encoding: utf-8 # after Model defined | 1.907743 | 2 |
Betsy/Betsy/modules/get_illumina_control.py | jefftc/changlab | 9 | 1784 | from Module import AbstractModule
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, antecedents, out_attributes, user_options, num_cores,
outfile):
import os
import shutil
from genomicode import filelib
... | from Module import AbstractModule
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, antecedents, out_attributes, user_options, num_cores,
outfile):
import os
import shutil
from genomicode import filelib
... | none | 1 | 2.267687 | 2 | |
src/backup/template/PositionalArgumentTemplate.py | ytyaru0/Python.TemplateFileMaker.20180314204216 | 0 | 1785 | <gh_stars>0
from string import Template
import re
class PositionalArgumentTemplate(Template):
# (?i): 大文字小文字を区別しないモードを開始する
# (?-i): 大文字小文字を区別しないモードを無効にする
idpattern_default = Template.idpattern # (?-i:[_a-zA-Z][_a-zA-Z0-9]*)
idpattern = '([0-9]+)'
def find_place_holders(self, template:str):
... | from string import Template
import re
class PositionalArgumentTemplate(Template):
# (?i): 大文字小文字を区別しないモードを開始する
# (?-i): 大文字小文字を区別しないモードを無効にする
idpattern_default = Template.idpattern # (?-i:[_a-zA-Z][_a-zA-Z0-9]*)
idpattern = '([0-9]+)'
def find_place_holders(self, template:str):
#for m in re... | ja | 0.307342 | # (?i): 大文字小文字を区別しないモードを開始する # (?-i): 大文字小文字を区別しないモードを無効にする # (?-i:[_a-zA-Z][_a-zA-Z0-9]*) #for m in re.findall(self.pattern, template): #for m in re.finditer(self.pattern, template): #print(dir(m)) #print(len(m.groups())) #print(m.groups()) #print(m, m.groups(), m.group('named'), type(m)) #print(m.group('escaped')) #p... | 2.913615 | 3 |
cla-backend/cla/tests/unit/test_company.py | kdhaigud/easycla | 0 | 1786 | <filename>cla-backend/cla/tests/unit/test_company.py<gh_stars>0
# Copyright The Linux Foundation and each contributor to CommunityBridge.
# SPDX-License-Identifier: MIT
import json
import os
import requests
import uuid
import hug
import pytest
from falcon import HTTP_200, HTTP_409
import cla
from cla import routes
... | <filename>cla-backend/cla/tests/unit/test_company.py<gh_stars>0
# Copyright The Linux Foundation and each contributor to CommunityBridge.
# SPDX-License-Identifier: MIT
import json
import os
import requests
import uuid
import hug
import pytest
from falcon import HTTP_200, HTTP_409
import cla
from cla import routes
... | en | 0.612469 | # Copyright The Linux Foundation and each contributor to CommunityBridge. # SPDX-License-Identifier: MIT Test creating duplicate company names # add duplicate company | 2.190922 | 2 |
py/WatchDialog.py | mathematicalmichael/SpringNodes | 51 | 1787 | <gh_stars>10-100
# Copyright(c) 2017, <NAME>
# @5devene, <EMAIL>
# www.badmonkeys.net
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Drawing import Point, Color, Font
from System.Windows.Forms import *
from cStringIO import StringIO
str_file = StringIO()
size1 = [3... | # Copyright(c) 2017, <NAME>
# @5devene, <EMAIL>
# www.badmonkeys.net
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Drawing import Point, Color, Font
from System.Windows.Forms import *
from cStringIO import StringIO
str_file = StringIO()
size1 = [30, 23] #height, w... | en | 0.796017 | # Copyright(c) 2017, <NAME> # @5devene, <EMAIL> # www.badmonkeys.net #height, width #is element #character width seems to vary between PCs | 2.511455 | 3 |
292-nim-game.py | mvj3/leetcode | 0 | 1788 | """
Question:
Nim Game My Submissions Question
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones.
Bot... | """
Question:
Nim Game My Submissions Question
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones.
Bot... | en | 0.890424 | Question: Nim Game My Submissions Question You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones. Both of... | 3.74449 | 4 |
script_tests/maf_extract_ranges_indexed_tests.py | lldelisle/bx-python | 122 | 1789 | import unittest
import base
class Test(base.BaseScriptTest, unittest.TestCase):
command_line = "./scripts/maf_extract_ranges_indexed.py ./test_data/maf_tests/mm8_chr7_tiny.maf -c -m 5 -p mm8."
input_stdin = base.TestFile(filename="./test_data/maf_tests/dcking_ghp074.bed")
output_stdout = base.TestFile(fi... | import unittest
import base
class Test(base.BaseScriptTest, unittest.TestCase):
command_line = "./scripts/maf_extract_ranges_indexed.py ./test_data/maf_tests/mm8_chr7_tiny.maf -c -m 5 -p mm8."
input_stdin = base.TestFile(filename="./test_data/maf_tests/dcking_ghp074.bed")
output_stdout = base.TestFile(fi... | none | 1 | 2.070442 | 2 | |
qstklearn/1knn.py | elxavicio/QSTK | 339 | 1790 | <filename>qstklearn/1knn.py<gh_stars>100-1000
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Feb 20, 2011
@author: <NAME>
@organization: Georgia I... | <filename>qstklearn/1knn.py<gh_stars>100-1000
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Feb 20, 2011
@author: <NAME>
@organization: Georgia I... | en | 0.762537 | (c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Feb 20, 2011
@author: <NAME>
@organization: Georgia Institute of Technology
@contact: <EMAIL>
@summary... | 2.61121 | 3 |
pyscf/nao/m_comp_coulomb_pack.py | robert-anderson/pyscf | 2 | 1791 | <filename>pyscf/nao/m_comp_coulomb_pack.py<gh_stars>1-10
# Copyright 2014-2018 The PySCF Developers. 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.ap... | <filename>pyscf/nao/m_comp_coulomb_pack.py<gh_stars>1-10
# Copyright 2014-2018 The PySCF Developers. 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.ap... | en | 0.745604 | # Copyright 2014-2018 The PySCF Developers. 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 appl... | 1.882985 | 2 |
nova/tests/unit/test_service_auth.py | panguan737/nova | 0 | 1792 | # 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
# d... | # 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
# d... | en | 0.887587 | # 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 # d... | 1.783858 | 2 |
classification/model/build_gen.py | LittleWat/MCD_DA | 464 | 1793 | import svhn2mnist
import usps
import syn2gtrsb
import syndig2svhn
def Generator(source, target, pixelda=False):
if source == 'usps' or target == 'usps':
return usps.Feature()
elif source == 'svhn':
return svhn2mnist.Feature()
elif source == 'synth':
return syn2gtrsb.Feature()
def ... | import svhn2mnist
import usps
import syn2gtrsb
import syndig2svhn
def Generator(source, target, pixelda=False):
if source == 'usps' or target == 'usps':
return usps.Feature()
elif source == 'svhn':
return svhn2mnist.Feature()
elif source == 'synth':
return syn2gtrsb.Feature()
def ... | none | 1 | 2.589741 | 3 | |
deep_table/nn/models/loss/info_nce_loss.py | pfnet-research/deep-table | 48 | 1794 | <reponame>pfnet-research/deep-table<filename>deep_table/nn/models/loss/info_nce_loss.py
import torch
from torch import Tensor
from torch.nn.modules.loss import _Loss
class InfoNCELoss(_Loss):
"""Info NCE Loss. A type of contrastive loss function used for self-supervised learning.
References:
<NAME>, ... | import torch
from torch import Tensor
from torch.nn.modules.loss import _Loss
class InfoNCELoss(_Loss):
"""Info NCE Loss. A type of contrastive loss function used for self-supervised learning.
References:
<NAME>, <NAME>, and <NAME>,
"Representation Learning with Contrastive Predictive Coding,... | en | 0.803723 | Info NCE Loss. A type of contrastive loss function used for self-supervised learning. References: <NAME>, <NAME>, and <NAME>, "Representation Learning with Contrastive Predictive Coding," ArXiv:1807.03748 [cs.LG], 2018. <https://arxiv.org/abs/1807.03748v2> Args: reduction (str) | 3.246997 | 3 |
patroni/config.py | korkin25/patroni | 0 | 1795 | import json
import logging
import os
import shutil
import tempfile
import yaml
from collections import defaultdict
from copy import deepcopy
from patroni import PATRONI_ENV_PREFIX
from patroni.exceptions import ConfigParseError
from patroni.dcs import ClusterConfig
from patroni.postgresql.config import CaseInsensitive... | import json
import logging
import os
import shutil
import tempfile
import yaml
from collections import defaultdict
from copy import deepcopy
from patroni import PATRONI_ENV_PREFIX
from patroni.exceptions import ConfigParseError
from patroni.dcs import ClusterConfig
from patroni.postgresql.config import CaseInsensitive... | en | 0.770993 | This class is responsible for: 1) Building and giving access to `effective_configuration` from: * `Config.__DEFAULT_CONFIG` -- some sane default values * `dynamic_configuration` -- configuration stored in DCS * `local_configuration` -- configuration from `config.yml` or environment ... | 2.251258 | 2 |
src/Products/CMFCore/tests/test_DirectoryView.py | fdiary/Products.CMFCore | 3 | 1796 | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | en | 0.868459 | ############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I... | 1.911442 | 2 |
pycycle/elements/flight_conditions.py | eshendricks/pyCycle | 0 | 1797 | import openmdao.api as om
from pycycle.thermo.cea import species_data
from pycycle.constants import AIR_ELEMENTS
from pycycle.elements.ambient import Ambient
from pycycle.elements.flow_start import FlowStart
class FlightConditions(om.Group):
"""Determines total and static flow properties given an altitude and Ma... | import openmdao.api as om
from pycycle.thermo.cea import species_data
from pycycle.constants import AIR_ELEMENTS
from pycycle.elements.ambient import Ambient
from pycycle.elements.flow_start import FlowStart
class FlightConditions(om.Group):
"""Determines total and static flow properties given an altitude and Ma... | en | 0.301005 | Determines total and static flow properties given an altitude and Mach number using the input atmosphere model # inputs # sub.set_order(['fs','balance']) # newton.linesearch.options['solve_subsystems'] = True # self.set_order(['ambient', 'subgroup']) # p1.root.list_connections() | 2.322429 | 2 |
server/cauth/views.py | mashaka/TravelHelper | 0 | 1798 | <reponame>mashaka/TravelHelper
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AdminPasswordChangeForm, PasswordChangeForm, UserCreationForm
from django.contrib.auth import update_session_auth_hash, login, authenticate
from django.cont... | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AdminPasswordChangeForm, PasswordChangeForm, UserCreationForm
from django.contrib.auth import update_session_auth_hash, login, authenticate
from django.contrib import messages
from django... | none | 1 | 2.10553 | 2 | |
samples/modules/tensorflow/magic_wand/train/data_split_person.py | lviala-zaack/zephyr | 6,224 | 1799 | # Lint as: python3
# coding=utf-8
# Copyright 2019 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/LICE... | # Lint as: python3
# coding=utf-8
# Copyright 2019 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/LICE... | en | 0.83473 | # Lint as: python3 # coding=utf-8 # Copyright 2019 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/LICE... | 2.869682 | 3 |