hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70cb531f0d051e17a54782543c3607133af43c5 | 10,577 | py | Python | tests/test_edgeql_userddl.py | haikyuu/edgedb | 73125882a4eff337692ad10af4bfdf15eef341ab | [
"Apache-2.0"
] | null | null | null | tests/test_edgeql_userddl.py | haikyuu/edgedb | 73125882a4eff337692ad10af4bfdf15eef341ab | [
"Apache-2.0"
] | null | null | null | tests/test_edgeql_userddl.py | haikyuu/edgedb | 73125882a4eff337692ad10af4bfdf15eef341ab | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2018-present MagicStack Inc. and the EdgeDB 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... | 34.452769 | 74 | 0.502695 |
import edgedb
from edb.testbase import server as tb
class TestEdgeQLUserDDL(tb.DDLTestCase):
INTERNAL_TESTMODE = False
async def test_edgeql_userddl_01(self):
with self.assertRaisesRegex(
edgedb.InvalidFunctionDefinitionError,
r'cannot create.*test::func_01.... | true | true |
f70cb62b82822ffa1aaa43899d060bc7e23fed1e | 11,377 | py | Python | aoc2021/d18.py | jbudynek/advent-of-code | 16ab71b110e9766b445bce3d3172b11d421b2f75 | [
"CC0-1.0"
] | null | null | null | aoc2021/d18.py | jbudynek/advent-of-code | 16ab71b110e9766b445bce3d3172b11d421b2f75 | [
"CC0-1.0"
] | null | null | null | aoc2021/d18.py | jbudynek/advent-of-code | 16ab71b110e9766b445bce3d3172b11d421b2f75 | [
"CC0-1.0"
] | null | null | null | # coding: utf-8
import copy
from timeit import default_timer as timer
import numpy as np
# Main function
##########
class Pair:
def __init__(self, lhs, rhs, parent):
self.lhs = lhs
self.rhs = rhs
self.parent = parent
def __str__(self):
return "["+str(self.lhs)+","+str(self.r... | 24.466667 | 94 | 0.54452 | import copy
from timeit import default_timer as timer
import numpy as np
class Pair:
def __init__(self, lhs, rhs, parent):
self.lhs = lhs
self.rhs = rhs
self.parent = parent
def __str__(self):
return "["+str(self.lhs)+","+str(self.rhs)+"]"
class RegularNumber:
def __in... | true | true |
f70cb65970c65875e3f0aa0fc55bcef6c0fa0575 | 3,752 | py | Python | markdownextradata/plugin.py | timvink/mkdocs-markdownextradata-plugin | 35e91288a97aee8b4302c4e06b140c21339c4ca0 | [
"MIT"
] | null | null | null | markdownextradata/plugin.py | timvink/mkdocs-markdownextradata-plugin | 35e91288a97aee8b4302c4e06b140c21339c4ca0 | [
"MIT"
] | null | null | null | markdownextradata/plugin.py | timvink/mkdocs-markdownextradata-plugin | 35e91288a97aee8b4302c4e06b140c21339c4ca0 | [
"MIT"
] | null | null | null | import os
import sys
import json
import yaml
import mkdocs
import logging
from mkdocs.plugins import BasePlugin
from mkdocs.utils import warning_filter
from jinja2 import Template
from pathlib import Path
from itertools import chain
log = logging.getLogger(__name__)
log.addFilter(warning_filter)
CONFIG_KEYS = ["site... | 36.076923 | 95 | 0.577026 | import os
import sys
import json
import yaml
import mkdocs
import logging
from mkdocs.plugins import BasePlugin
from mkdocs.utils import warning_filter
from jinja2 import Template
from pathlib import Path
from itertools import chain
log = logging.getLogger(__name__)
log.addFilter(warning_filter)
CONFIG_KEYS = ["site... | true | true |
f70cb6789bae3b78fdb0e73196234cc5eaacd775 | 543 | py | Python | graphql/flask-graphql-basic_example2/app.py | CALlanoR/virtual_environments | 90214851d6c3760e1a4afb48017bb7f91593e29e | [
"Apache-2.0"
] | null | null | null | graphql/flask-graphql-basic_example2/app.py | CALlanoR/virtual_environments | 90214851d6c3760e1a4afb48017bb7f91593e29e | [
"Apache-2.0"
] | 1 | 2022-03-02T14:54:47.000Z | 2022-03-02T14:54:47.000Z | graphql/flask-graphql-basic_example2/app.py | CALlanoR/virtual_environments | 90214851d6c3760e1a4afb48017bb7f91593e29e | [
"Apache-2.0"
] | 1 | 2017-03-16T14:58:03.000Z | 2017-03-16T14:58:03.000Z | from flask import Flask
from flask_graphql import GraphQLView
from models import db_session
from schema import schema, Department
app = Flask(__name__)
app.debug = True
@app.route('/')
def index():
return '<p> Hello World!</p>'
app.add_url_rule(
'/graphql',
view_func=GraphQLView.as_view(
'graph... | 18.724138 | 57 | 0.694291 | from flask import Flask
from flask_graphql import GraphQLView
from models import db_session
from schema import schema, Department
app = Flask(__name__)
app.debug = True
@app.route('/')
def index():
return '<p> Hello World!</p>'
app.add_url_rule(
'/graphql',
view_func=GraphQLView.as_view(
'graph... | true | true |
f70cb75614df1aabae615c947e2d378f160ddaa4 | 79,848 | py | Python | collective/zopeedit/zopeedit.py | gotcha/collective.zopeedit | 74359958d9b9ed33ee0f1c933d5d8cd1963c40fe | [
"ZPL-2.1"
] | null | null | null | collective/zopeedit/zopeedit.py | gotcha/collective.zopeedit | 74359958d9b9ed33ee0f1c933d5d8cd1963c40fe | [
"ZPL-2.1"
] | null | null | null | collective/zopeedit/zopeedit.py | gotcha/collective.zopeedit | 74359958d9b9ed33ee0f1c933d5d8cd1963c40fe | [
"ZPL-2.1"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# Copyright (c) 2005-2010 Thierry Benita - atReal <contact@atreal.net>
# All Rights Reserved.
#
# This software is subject to the prov... | 39.489614 | 102 | 0.52089 | """Zope External Editor Helper Application
http://plone.org/products/zope-externaleditor-client"""
APP_NAME = 'zopeedit'
import sys
import os
try:
system_path=os.path.split(__file__)[0]
except NameError:
system_path = os.path.realpath( os.path.dirname( sys.argv[0] ) )
if os.path.exists(os.path.join(system... | false | true |
f70cb75e06707f355bad7ef96e6deb9bd473dc24 | 3,291 | py | Python | MICRO_CPU_profiling/plot_SIFT1000M/plot_profiling_experiment_4_nprobe.py | WenqiJiang/faiss-cpu-profiling | f2c7b3051f8860e8918c713ef4baddd563cc515c | [
"MIT"
] | null | null | null | MICRO_CPU_profiling/plot_SIFT1000M/plot_profiling_experiment_4_nprobe.py | WenqiJiang/faiss-cpu-profiling | f2c7b3051f8860e8918c713ef4baddd563cc515c | [
"MIT"
] | null | null | null | MICRO_CPU_profiling/plot_SIFT1000M/plot_profiling_experiment_4_nprobe.py | WenqiJiang/faiss-cpu-profiling | f2c7b3051f8860e8918c713ef4baddd563cc515c | [
"MIT"
] | null | null | null | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
from analyze_perf import group_perf_by_events, filter_events_after_timestamp, \
classify_events_by_stages, get_percentage
from profiling_stages import draw_profiling_plot
x_labels = ['OPQ16,IVF262144\nnprobe=1', \
'OPQ16,IVF26214... | 36.566667 | 143 | 0.718323 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
from analyze_perf import group_perf_by_events, filter_events_after_timestamp, \
classify_events_by_stages, get_percentage
from profiling_stages import draw_profiling_plot
x_labels = ['OPQ16,IVF262144\nnprobe=1', \
'OPQ16,IVF26214... | true | true |
f70cb7897a6a577a01800875e9d620824adf7fe5 | 784 | py | Python | p038.py | piohhmy/euler | f1b548a28a503fb8a0878fda75c32e1dcfb33243 | [
"MIT"
] | null | null | null | p038.py | piohhmy/euler | f1b548a28a503fb8a0878fda75c32e1dcfb33243 | [
"MIT"
] | null | null | null | p038.py | piohhmy/euler | f1b548a28a503fb8a0878fda75c32e1dcfb33243 | [
"MIT"
] | null | null | null | def concat_multiples(num, multiples):
return int("".join([str(num*multiple) for multiple in range(1,multiples+1)]))
def is_pandigital(num):
return sorted([int(digit) for digit in str(num)]) == list(range(1,10))
def solve_p038():
# retrieve only 9 digit concatinations of multiples where n = (1,2,..n)
... | 37.333333 | 81 | 0.659439 | def concat_multiples(num, multiples):
return int("".join([str(num*multiple) for multiple in range(1,multiples+1)]))
def is_pandigital(num):
return sorted([int(digit) for digit in str(num)]) == list(range(1,10))
def solve_p038():
n6 = [concat_multiples(num, 6) for num in [3]]
n5 = [concat_mult... | true | true |
f70cb81d6cb4681978d9f6a592d2d4785bab8056 | 4,159 | py | Python | utils/UserUtils.py | vishu221b/bookme-flask-REST-API-Collection | 9ee923e13d786af9b11421370edac718743855af | [
"MIT"
] | null | null | null | utils/UserUtils.py | vishu221b/bookme-flask-REST-API-Collection | 9ee923e13d786af9b11421370edac718743855af | [
"MIT"
] | null | null | null | utils/UserUtils.py | vishu221b/bookme-flask-REST-API-Collection | 9ee923e13d786af9b11421370edac718743855af | [
"MIT"
] | null | null | null | import models
import json
import re
import constants.userConstants as UserConstants
from enums import UserEnums
from databaseService.bookDatabaseService import BookDatabaseService
def validate_and_convert_new_user_request_object(aa: dict, bb: models.User):
for field in UserConstants.USER_MANDATORY_FIELDS:
... | 36.482456 | 116 | 0.689108 | import models
import json
import re
import constants.userConstants as UserConstants
from enums import UserEnums
from databaseService.bookDatabaseService import BookDatabaseService
def validate_and_convert_new_user_request_object(aa: dict, bb: models.User):
for field in UserConstants.USER_MANDATORY_FIELDS:
... | true | true |
f70cb8387afcc1faddc7425cb48245392fbb3a47 | 779 | py | Python | django/conf/locale/fa/formats.py | benjaoming/django | 6dbe979b4d9396e1b307c7d27388c97c13beb21c | [
"BSD-3-Clause"
] | 2 | 2015-01-21T15:45:07.000Z | 2015-02-21T02:38:13.000Z | django/conf/locale/fa/formats.py | HenriqueLR/django | d1ca70110f49f0be90206c8da516ac16aebc8c75 | [
"BSD-3-Clause"
] | null | null | null | django/conf/locale/fa/formats.py | HenriqueLR/django | d1ca70110f49f0be90206c8da516ac16aebc8c75 | [
"BSD-3-Clause"
] | 1 | 2021-03-06T14:22:00.000Z | 2021-03-06T14:22:00.000Z | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'G:i'
DATETI... | 31.16 | 77 | 0.750963 | from __future__ import unicode_literals
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j F Y، ساعت G:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'Y/n/j'
SHORT_DATETIME_FORMAT = 'Y/n/j، G:i'
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
| true | true |
f70cb844699855bb0927d27e9ebd6c814ab45767 | 584 | py | Python | HW_Controls/test_servo_sanity_check.py | NerdboyQ/Raspberry_Pi_Learning | ad6d9e658d456bbce9a8d09f6bc983f66d8ecbf3 | [
"MIT"
] | null | null | null | HW_Controls/test_servo_sanity_check.py | NerdboyQ/Raspberry_Pi_Learning | ad6d9e658d456bbce9a8d09f6bc983f66d8ecbf3 | [
"MIT"
] | null | null | null | HW_Controls/test_servo_sanity_check.py | NerdboyQ/Raspberry_Pi_Learning | ad6d9e658d456bbce9a8d09f6bc983f66d8ecbf3 | [
"MIT"
] | 1 | 2021-07-18T18:16:34.000Z | 2021-07-18T18:16:34.000Z | from car_ctrl import servo
import time
#max angle turns right
#0 turns left
def test_servo_rotation():
s = servo()
print(vars(s))
print("max_angle: " +str(s.max_angle))
print("slope: " +str(s.slope))
for i in range(0,3):
s.steer(s.max_angle)
print("turning left")
time.sleep(0... | 20.857143 | 42 | 0.578767 | from car_ctrl import servo
import time
def test_servo_rotation():
s = servo()
print(vars(s))
print("max_angle: " +str(s.max_angle))
print("slope: " +str(s.slope))
for i in range(0,3):
s.steer(s.max_angle)
print("turning left")
time.sleep(0.5)
for i in range(0,3):
... | true | true |
f70cb881eeadfc9235bf32aed10635460d74828d | 644 | py | Python | config.py | millywayne/PITCH-NOW | 67f5a5ae7e4d99c5ed2eb87a0335f89372c0813b | [
"MIT"
] | null | null | null | config.py | millywayne/PITCH-NOW | 67f5a5ae7e4d99c5ed2eb87a0335f89372c0813b | [
"MIT"
] | null | null | null | config.py | millywayne/PITCH-NOW | 67f5a5ae7e4d99c5ed2eb87a0335f89372c0813b | [
"MIT"
] | null | null | null |
import os
class Config:
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = os.environ.get('SECRET_KEY')
UPLOADED_PHOTOS_DEST = 'app/static/photos'
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 450
MAIL_USE_TLS = False
MAIL_USE_SSL = ... | 23 | 60 | 0.717391 |
import os
class Config:
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = os.environ.get('SECRET_KEY')
UPLOADED_PHOTOS_DEST = 'app/static/photos'
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 450
MAIL_USE_TLS = False
MAIL_USE_SSL = ... | true | true |
f70cb9155b794d8ba907ec634161848c361b78f1 | 3,671 | py | Python | scrape_mars.py | tsubedy/web-scraping-challenge | 785faf0b9855086dedaef1c1df2ea7b81a0dde4b | [
"MIT"
] | null | null | null | scrape_mars.py | tsubedy/web-scraping-challenge | 785faf0b9855086dedaef1c1df2ea7b81a0dde4b | [
"MIT"
] | null | null | null | scrape_mars.py | tsubedy/web-scraping-challenge | 785faf0b9855086dedaef1c1df2ea7b81a0dde4b | [
"MIT"
] | null | null | null |
# Dependencies
from splinter import Browser
from bs4 import BeautifulSoup
from webdriver_manager.chrome import ChromeDriverManager
import time
import pandas as pd
from pprint import pprint
from urllib.parse import urlsplit
import pymongo
# Initialize PyMongo to work with MongoDBs
conn = 'mongodb://localhost:27017'
c... | 29.604839 | 213 | 0.6693 |
from splinter import Browser
from bs4 import BeautifulSoup
from webdriver_manager.chrome import ChromeDriverManager
import time
import pandas as pd
from pprint import pprint
from urllib.parse import urlsplit
import pymongo
conn = 'mongodb://localhost:27017'
client = pymongo.MongoClient(conn)
db = client.mars_db
col... | true | true |
f70cb9cb3840540bacd7f076130cfadbabaaf32f | 812 | py | Python | diff_of_files.py | mairieli/botSE-2019 | bfcda1197fccd05650db1e37c85c43db9e28b26d | [
"MIT"
] | null | null | null | diff_of_files.py | mairieli/botSE-2019 | bfcda1197fccd05650db1e37c85c43db9e28b26d | [
"MIT"
] | 1 | 2020-11-06T18:47:10.000Z | 2020-11-19T18:51:29.000Z | diff_of_files.py | mairieli/botSE-2019 | bfcda1197fccd05650db1e37c85c43db9e28b26d | [
"MIT"
] | null | null | null | from pydriller import RepositoryMining
import iocsv
import csv
repos = iocsv.read_csv_repos_fil("data_filtered.csv")
out = open('project_bot.csv', 'w')
w_out = csv.writer(out)
for commit in RepositoryMining(path_to_repo=repos, only_modifications_with_file_types= ['.yml']).traverse_commits():
files = []
for m... | 30.074074 | 168 | 0.669951 | from pydriller import RepositoryMining
import iocsv
import csv
repos = iocsv.read_csv_repos_fil("data_filtered.csv")
out = open('project_bot.csv', 'w')
w_out = csv.writer(out)
for commit in RepositoryMining(path_to_repo=repos, only_modifications_with_file_types= ['.yml']).traverse_commits():
files = []
for m... | true | true |
f70cbad2376446a505af61eaa2bb681268c8b57c | 638 | py | Python | src/apis/text/text/transliteration.py | theunifai/unifai-apis-core | 1f2a9051c1e3df1bd19a96f22e4a07767ef3973a | [
"MIT"
] | 2 | 2021-11-09T07:18:06.000Z | 2022-01-04T19:37:17.000Z | src/apis/text/text/transliteration.py | theunifai/unifai-apis-core | 1f2a9051c1e3df1bd19a96f22e4a07767ef3973a | [
"MIT"
] | 4 | 2021-11-04T08:28:59.000Z | 2021-11-07T05:59:59.000Z | src/apis/text/text/transliteration.py | theunifai/unifai-apis-core | 1f2a9051c1e3df1bd19a96f22e4a07767ef3973a | [
"MIT"
] | 1 | 2022-01-07T09:12:22.000Z | 2022-01-07T09:12:22.000Z | from fastapi import APIRouter
from gladia_api_utils.submodules import TaskRouter
router = APIRouter()
inputs = [
{
"type": "text",
"name": "text",
"default": "Лорем ипсум долор сит амет",
"tooltip": "Insert the text to transliterate here",
},
{
"type": "text",
... | 22.785714 | 85 | 0.581505 | from fastapi import APIRouter
from gladia_api_utils.submodules import TaskRouter
router = APIRouter()
inputs = [
{
"type": "text",
"name": "text",
"default": "Лорем ипсум долор сит амет",
"tooltip": "Insert the text to transliterate here",
},
{
"type": "text",
... | true | true |
f70cbb17e5522f2101a01509fdf02a32b98ffdba | 3,081 | py | Python | flatpandoc.py | apas/athena | 74e79723c53237275c40c10731717d7ca0dc130d | [
"MIT"
] | 321 | 2016-06-04T11:49:15.000Z | 2022-01-05T17:01:26.000Z | flatpandoc.py | apas/athena | 74e79723c53237275c40c10731717d7ca0dc130d | [
"MIT"
] | 17 | 2016-06-12T18:08:44.000Z | 2020-08-08T09:31:17.000Z | flatpandoc.py | apas/athena | 74e79723c53237275c40c10731717d7ca0dc130d | [
"MIT"
] | 40 | 2016-06-12T17:35:23.000Z | 2022-02-04T18:35:55.000Z | """
flask_flatpages_pandoc
~~~~~~~~~~~~~~~~~~~~~~
Flask-FlatPages-Pandoc is an HTML renderer for Flask-FlatPages that uses
pandoc as backend.
:copyright: (c) 2014 Fabian Hirschmann <fabian@hirschmann.email>
:license: MIT, see LICENSE.txt for more details.
With some changes by @apas:
- Invoke pandoc via pypandoc i... | 26.560345 | 81 | 0.666667 |
import pkg_resources
import pypandoc
from flask import render_template_string, Markup
try:
__version__ = pkg_resources.require("Flask-FlatPages-Pandoc")[0]
except pkg_resources.DistributionNotFound:
__version__ = "0.0-dev"
class FlatPagesPandoc(object):
def __init__(self, source_format, app=None, pandoc_args=... | true | true |
f70cbc1338df7077e1e741af0d075462ddf93d9d | 1,528 | py | Python | Kai/crab/NANOv7_Fri13/2018/ST/crab_cfg_2018_ST_tW.py | NJManganelli/FourTopNAOD | 9743d5b49bdbad27a74abb7b2d5b7295f678a0e3 | [
"Apache-2.0"
] | 1 | 2022-01-17T17:29:38.000Z | 2022-01-17T17:29:38.000Z | Kai/crab/NANOv7_Fri13/2018/ST/crab_cfg_2018_ST_tW.py | NJManganelli/FourTopNAOD | 9743d5b49bdbad27a74abb7b2d5b7295f678a0e3 | [
"Apache-2.0"
] | null | null | null | Kai/crab/NANOv7_Fri13/2018/ST/crab_cfg_2018_ST_tW.py | NJManganelli/FourTopNAOD | 9743d5b49bdbad27a74abb7b2d5b7295f678a0e3 | [
"Apache-2.0"
] | 1 | 2021-12-15T10:56:50.000Z | 2021-12-15T10:56:50.000Z | import os
from WMCore.Configuration import Configuration
from CRABClient.UserUtilities import config, getUsernameFromCRIC
config = Configuration()
config.section_("General")
config.General.requestName = '2018_ST_tW'
config.General.transferOutputs = True
config.General.transferLogs = True
config.section_("JobType")
co... | 39.179487 | 174 | 0.777487 | import os
from WMCore.Configuration import Configuration
from CRABClient.UserUtilities import config, getUsernameFromCRIC
config = Configuration()
config.section_("General")
config.General.requestName = '2018_ST_tW'
config.General.transferOutputs = True
config.General.transferLogs = True
config.section_("JobType")
co... | true | true |
f70cbc8b3b98f38e47c4f74a3b7d54186d5f3d15 | 333 | py | Python | sandbox/lib/jumpscale/JumpScale9Lib/clients/gogs/GogsFactory.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | 2 | 2017-06-07T08:11:47.000Z | 2017-11-10T02:19:48.000Z | JumpScale9Lib/clients/gogs/GogsFactory.py | Jumpscale/lib9 | 82224784ef2a7071faeb48349007211c367bc673 | [
"Apache-2.0"
] | 188 | 2017-06-21T06:16:13.000Z | 2020-06-17T14:20:24.000Z | sandbox/lib/jumpscale/JumpScale9Lib/clients/gogs/GogsFactory.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | 3 | 2018-06-12T05:18:28.000Z | 2019-09-24T06:49:17.000Z | from .GogsClient import GogsClient
from js9 import j
JSConfigBaseFactory = j.tools.configmanager.base_class_configs
class GogsFactory(JSConfigBaseFactory):
def __init__(self):
self.__jslocation__ = "j.clients.gogs"
self.__imports__ = "requests,psycopg2"
JSConfigBaseFactory.__init__(self,... | 25.615385 | 62 | 0.756757 | from .GogsClient import GogsClient
from js9 import j
JSConfigBaseFactory = j.tools.configmanager.base_class_configs
class GogsFactory(JSConfigBaseFactory):
def __init__(self):
self.__jslocation__ = "j.clients.gogs"
self.__imports__ = "requests,psycopg2"
JSConfigBaseFactory.__init__(self,... | true | true |
f70cbccefa5857dc098e4aa84320e84b66e9b510 | 5,962 | py | Python | tests/integration/test_mutations_hardlinks/test.py | chalice19/ClickHouse | 2f38e7bc5c2113935ab86260439bb543a1737291 | [
"Apache-2.0"
] | 8,629 | 2016-06-14T21:03:01.000Z | 2019-09-23T07:46:38.000Z | tests/integration/test_mutations_hardlinks/test.py | chalice19/ClickHouse | 2f38e7bc5c2113935ab86260439bb543a1737291 | [
"Apache-2.0"
] | 4,335 | 2016-06-15T12:58:31.000Z | 2019-09-23T11:18:43.000Z | tests/integration/test_mutations_hardlinks/test.py | chalice19/ClickHouse | 2f38e7bc5c2113935ab86260439bb543a1737291 | [
"Apache-2.0"
] | 1,700 | 2016-06-15T09:25:11.000Z | 2019-09-23T11:16:38.000Z | import os
import time
from multiprocessing.dummy import Pool
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance("node1", main_configs=["configs/wide_parts_only.xml"])
@pytest.fixture(scop... | 31.378947 | 126 | 0.661691 | import os
import time
from multiprocessing.dummy import Pool
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance("node1", main_configs=["configs/wide_parts_only.xml"])
@pytest.fixture(scop... | true | true |
f70cbdb054754ef3a69b9032f0332e2b00e041b8 | 841 | py | Python | blueprints/aws_s3_bucket/management/upload-file-object.py | hciudad/cloudbolt-forge | d1109c90dcd189defa70876906d394e0c91feab5 | [
"Apache-2.0"
] | null | null | null | blueprints/aws_s3_bucket/management/upload-file-object.py | hciudad/cloudbolt-forge | d1109c90dcd189defa70876906d394e0c91feab5 | [
"Apache-2.0"
] | null | null | null | blueprints/aws_s3_bucket/management/upload-file-object.py | hciudad/cloudbolt-forge | d1109c90dcd189defa70876906d394e0c91feab5 | [
"Apache-2.0"
] | null | null | null | from common.methods import set_progress
from resourcehandlers.aws.models import AWSHandler
def run(job, resource, **kwargs):
set_progress("Connecting to AWS s3 cloud")
aws = AWSHandler.objects.get(id=resource.aws_rh_id)
wrapper = aws.get_api_wrapper()
set_progress("This resource belongs to {}".format... | 30.035714 | 114 | 0.662307 | from common.methods import set_progress
from resourcehandlers.aws.models import AWSHandler
def run(job, resource, **kwargs):
set_progress("Connecting to AWS s3 cloud")
aws = AWSHandler.objects.get(id=resource.aws_rh_id)
wrapper = aws.get_api_wrapper()
set_progress("This resource belongs to {}".format... | true | true |
f70cbe6619bf7fdcb6ced25a2c9399e389f26f25 | 2,412 | py | Python | tank-generator-script/tank.py | the-other-mariana/maya-scripts | 6af1fdea243990081b8aeb3c5aa1bf07852ff0a3 | [
"MIT"
] | 2 | 2021-11-17T23:01:13.000Z | 2021-11-27T18:28:38.000Z | tank-generator-script/tank.py | the-other-mariana/maya-scripts | 6af1fdea243990081b8aeb3c5aa1bf07852ff0a3 | [
"MIT"
] | null | null | null | tank-generator-script/tank.py | the-other-mariana/maya-scripts | 6af1fdea243990081b8aeb3c5aa1bf07852ff0a3 | [
"MIT"
] | null | null | null | #File: tank.py
#Author: Mariana Avalos
#Date: 22/02/2019
#Description: Python code that makes a 3D tank
import maya.cmds as c
import math as math
# 8 tires
tireTranslation = [3, -3]
tireRadius = 1.25
for j in range(len(tireTranslation)):
for i in range(4):
name = 'c' + str(i + (j * 4) + 1)
... | 34.457143 | 89 | 0.541459 |
import maya.cmds as c
import math as math
tireTranslation = [3, -3]
tireRadius = 1.25
for j in range(len(tireTranslation)):
for i in range(4):
name = 'c' + str(i + (j * 4) + 1)
c.polyCylinder(r = tireRadius, sx = 20, sy = 1, n = 'c' + str(i + (j * 4) + 1))
c.setAttr(name + '.rotateZ', 90)
... | true | true |
f70cbee84274bde26aeddaa7ebed722c81efeeab | 22,746 | py | Python | sdk/storage/azure-storage-blob/azure/storage/blob/_shared/uploads.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/storage/azure-storage-blob/azure/storage/blob/_shared/uploads.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-blob/azure/storage/blob/_shared/uploads.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: ... | 36.628019 | 116 | 0.622483 |
from concurrent import futures
from io import (BytesIO, IOBase, SEEK_CUR, SEEK_END, SEEK_SET, UnsupportedOperation)
from threading import Lock
from itertools import islice
from math import ceil
import six
from azure.core.tracing.common import with_current_context
from . import encode_base64, url_quote
from .request... | true | true |
f70cbfab08e86ea8aa181c3d36fe24445d6ac075 | 4,273 | py | Python | clusters/dataset_utils.py | danielamassiceti/geneval_visdial | fbbe12b1e4ed7e21a002b16a87bdf42b2af3b35e | [
"MIT"
] | 4 | 2020-08-29T09:49:22.000Z | 2020-09-22T02:15:04.000Z | clusters/dataset_utils.py | danielamassiceti/geneval_visdial | fbbe12b1e4ed7e21a002b16a87bdf42b2af3b35e | [
"MIT"
] | null | null | null | clusters/dataset_utils.py | danielamassiceti/geneval_visdial | fbbe12b1e4ed7e21a002b16a87bdf42b2af3b35e | [
"MIT"
] | null | null | null | import sys
import utils
import torch
from datasets import VisualDialogDataset
import torchvision.transforms as transforms
def build_dataset(mode, args, shared_dictionary=None, with_options=True):
normalize = transforms.Normalize(mean=[0.4711, 0.4475, 0.4080], std=[0.1223, 0.1221, 0.1450]) #visdial
transf... | 39.201835 | 141 | 0.632811 | import sys
import utils
import torch
from datasets import VisualDialogDataset
import torchvision.transforms as transforms
def build_dataset(mode, args, shared_dictionary=None, with_options=True):
normalize = transforms.Normalize(mean=[0.4711, 0.4475, 0.4080], std=[0.1223, 0.1221, 0.1450]) transform = tran... | true | true |
f70cbfd58c3850aeb8634fd85c4b5c012fb5df22 | 3,311 | py | Python | src/utils/core_commands_utils.py | Sublime-Instincts/CommandsBrowser | 16ef299085854d1f4b61aaf8280c23c3f98a43a5 | [
"MIT"
] | 21 | 2021-11-15T14:18:50.000Z | 2022-03-31T12:35:41.000Z | src/utils/core_commands_utils.py | Sublime-Instincts/CommandsBrowser | 16ef299085854d1f4b61aaf8280c23c3f98a43a5 | [
"MIT"
] | 5 | 2021-11-15T11:23:12.000Z | 2022-02-02T19:28:13.000Z | src/utils/core_commands_utils.py | Sublime-Instincts/CommandsBrowser | 16ef299085854d1f4b61aaf8280c23c3f98a43a5 | [
"MIT"
] | 1 | 2021-11-23T11:50:18.000Z | 2021-11-23T11:50:18.000Z | import os
import json
import string
import inspect
import sublime
from .miscellaneous_utils import command_kind_type
kind_mapping = {
"window": command_kind_type("window"),
"text": command_kind_type("text"),
"application": command_kind_type("application"),
"find": command_kind_type("find")
}
def co... | 34.852632 | 144 | 0.659619 | import os
import json
import string
import inspect
import sublime
from .miscellaneous_utils import command_kind_type
kind_mapping = {
"window": command_kind_type("window"),
"text": command_kind_type("text"),
"application": command_kind_type("application"),
"find": command_kind_type("find")
}
def co... | true | true |
f70cc31b421f32a1e1227a2279a89d83e39d23df | 3,281 | py | Python | src/vprwave-bot.py | vornao/vaporwave-bot | 7af13d27aec50b72f407d4060b9cf4ec1c44a817 | [
"MIT"
] | null | null | null | src/vprwave-bot.py | vornao/vaporwave-bot | 7af13d27aec50b72f407d4060b9cf4ec1c44a817 | [
"MIT"
] | null | null | null | src/vprwave-bot.py | vornao/vaporwave-bot | 7af13d27aec50b72f407d4060b9cf4ec1c44a817 | [
"MIT"
] | null | null | null | # ⋆ ˚。⋆୨୧˚ v a p o r w a v e b o t ˚୨୧⋆。˚ ⋆
# Simple Telegram bot that converts standard unicode chars to full-width ones
# Unicode full width characters, means that all characters has the size of a chinese character.
# Full width characters goes from 0xFF1 to 0xFFE5
# Japanese hirigana char... | 27.341667 | 109 | 0.670527 |
import os
from telegram.inline.inlinequery import InlineQuery
from telegram.inline.inlinequeryresult import InlineQueryResult
from uuid import uuid4
from telegram import (
Update,
ParseMode,
InlineQueryResultArticle,
InputTextMessageContent,
)
from telegram.ext import (
Updater,
CommandHandl... | true | true |
f70cc349fc535bd4d262d2556742c1e4dca4b0d3 | 15,569 | py | Python | tools/BBAM/BBAM_utils.py | jbeomlee93/BBAM | bebd2358d0497960c9a8415e5dca8de4a25fd899 | [
"MIT"
] | 44 | 2021-03-17T03:00:01.000Z | 2022-03-30T03:30:44.000Z | tools/BBAM/BBAM_utils.py | jbeomlee93/BBAM | bebd2358d0497960c9a8415e5dca8de4a25fd899 | [
"MIT"
] | 5 | 2021-03-20T08:35:13.000Z | 2021-12-18T14:07:02.000Z | tools/BBAM/BBAM_utils.py | jbeomlee93/BBAM | bebd2358d0497960c9a8415e5dca8de4a25fd899 | [
"MIT"
] | 7 | 2021-06-15T14:10:31.000Z | 2022-01-27T14:16:26.000Z | import torch
from torch.autograd import Variable
from torchvision import models
import cv2
import sys
import numpy as np
import os
import math
import torch.nn.functional as F
idx_to_class = {0 : 'aeroplane', 1 : 'bicycle', 2 : 'bird', 3 : 'boat', 4 : 'bottle', 5 : 'bus', 6 : 'car', 7 : 'cat',
8 : 'chai... | 38.9225 | 202 | 0.558353 | import torch
from torch.autograd import Variable
from torchvision import models
import cv2
import sys
import numpy as np
import os
import math
import torch.nn.functional as F
idx_to_class = {0 : 'aeroplane', 1 : 'bicycle', 2 : 'bird', 3 : 'boat', 4 : 'bottle', 5 : 'bus', 6 : 'car', 7 : 'cat',
8 : 'chai... | true | true |
f70cc399eea6b881f6eba416d969374573c0ab6a | 1,251 | py | Python | tests/fixtures.py | owlen/wecs | 6c386d5215b4acef9e3208d0dd547c1ffc12c2f3 | [
"BSD-3-Clause"
] | null | null | null | tests/fixtures.py | owlen/wecs | 6c386d5215b4acef9e3208d0dd547c1ffc12c2f3 | [
"BSD-3-Clause"
] | null | null | null | tests/fixtures.py | owlen/wecs | 6c386d5215b4acef9e3208d0dd547c1ffc12c2f3 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from wecs.core import Entity, System, Component, World
from wecs.core import and_filter
# Absolute basics
@pytest.fixture
def world():
return World()
@pytest.fixture
def entity(world):
return world.create_entity()
# Null stuff
@Component()
class NullComponent:
pass
@pytest.fixture
d... | 18.397059 | 54 | 0.683453 | import pytest
from wecs.core import Entity, System, Component, World
from wecs.core import and_filter
@pytest.fixture
def world():
return World()
@pytest.fixture
def entity(world):
return world.create_entity()
@Component()
class NullComponent:
pass
@pytest.fixture
def null_component():
return... | true | true |
f70cc3d1fc5702c69ada755731dfb5a1e16e04d9 | 1,960 | py | Python | src/ship.py | tomice/Blast | 8521fb7784fc5269d3d54396f8d89933a78f6de5 | [
"MIT"
] | null | null | null | src/ship.py | tomice/Blast | 8521fb7784fc5269d3d54396f8d89933a78f6de5 | [
"MIT"
] | 1 | 2018-06-19T00:39:40.000Z | 2018-06-19T01:40:57.000Z | src/ship.py | tomice/Blast | 8521fb7784fc5269d3d54396f8d89933a78f6de5 | [
"MIT"
] | null | null | null | import pygame
from pygame.sprite import Sprite
class Ship(Sprite):
"""Parent ship class for Blast."""
def __init__(self, blast_settings, screen):
"""Init ship and starting position."""
super(Ship, self).__init__()
self.screen = screen
self.blast_settings = blast_setting... | 40 | 76 | 0.632653 | import pygame
from pygame.sprite import Sprite
class Ship(Sprite):
def __init__(self, blast_settings, screen):
super(Ship, self).__init__()
self.screen = screen
self.blast_settings = blast_settings
self.image = pygame.image.load('../images/player.png')
self.rect = s... | true | true |
f70cc529f83dccbb654eabbb0c5948d7aa829f83 | 313 | py | Python | exercicios/pietra/13-54-aula 13 desafio 54.py | justinharringa/aprendendo-python | b4e472033cc31e7827190cb18bc01b2d425e2f86 | [
"MIT"
] | null | null | null | exercicios/pietra/13-54-aula 13 desafio 54.py | justinharringa/aprendendo-python | b4e472033cc31e7827190cb18bc01b2d425e2f86 | [
"MIT"
] | null | null | null | exercicios/pietra/13-54-aula 13 desafio 54.py | justinharringa/aprendendo-python | b4e472033cc31e7827190cb18bc01b2d425e2f86 | [
"MIT"
] | null | null | null | n1 = int(input('qual sua idade ? '))
n2 = int(input('qual sua idade ? '))
n3 = int(input('qual sua idade ? '))
n4 = int(input('qual sua idade ? '))
n5 = int(input('qual sua idade ? '))
n6 = int(input('qual sua idade ? '))
n7 = int(input('qual sua idade ? '))
if n1 > n2,n3,n4,n5,n6,n7
#tia tbm não entendi | 34.777778 | 37 | 0.594249 | n1 = int(input('qual sua idade ? '))
n2 = int(input('qual sua idade ? '))
n3 = int(input('qual sua idade ? '))
n4 = int(input('qual sua idade ? '))
n5 = int(input('qual sua idade ? '))
n6 = int(input('qual sua idade ? '))
n7 = int(input('qual sua idade ? '))
if n1 > n2,n3,n4,n5,n6,n7
| false | true |
f70cc55037c706d87e86a8c70e78b1817357a3aa | 483 | py | Python | seeker/__init__.py | imszhongj/django-seeker | 6b1c4b03cd4d2ef8967496c0a9f76e032a425d00 | [
"BSD-2-Clause"
] | 24 | 2015-01-05T21:03:56.000Z | 2021-12-30T03:35:26.000Z | seeker/__init__.py | imszhongj/django-seeker | 6b1c4b03cd4d2ef8967496c0a9f76e032a425d00 | [
"BSD-2-Clause"
] | 30 | 2016-03-11T21:29:38.000Z | 2022-03-29T21:09:05.000Z | seeker/__init__.py | imszhongj/django-seeker | 6b1c4b03cd4d2ef8967496c0a9f76e032a425d00 | [
"BSD-2-Clause"
] | 30 | 2015-01-08T19:49:04.000Z | 2021-12-22T21:41:55.000Z | __version__ = '3.0-dev'
from .facets import Facet, GlobalTermsFacet, RangeFilter, TermsFacet, YearHistogram
from .mapping import (
DEFAULT_ANALYZER, Indexable, ModelIndex, RawMultiString, RawString, build_mapping, deep_field_factory,
document_field, document_from_model)
from .registry import app_documents, doc... | 37.153846 | 106 | 0.811594 | __version__ = '3.0-dev'
from .facets import Facet, GlobalTermsFacet, RangeFilter, TermsFacet, YearHistogram
from .mapping import (
DEFAULT_ANALYZER, Indexable, ModelIndex, RawMultiString, RawString, build_mapping, deep_field_factory,
document_field, document_from_model)
from .registry import app_documents, doc... | true | true |
f70cc577111a8772618560e037874544ea61f005 | 2,616 | py | Python | src/pyvfx_boilerplate/mayapalette.py | nzanepro/pyvfx.boilerplate | 7e51e97836204c5ff18c3aef97684bd6253b719a | [
"MIT"
] | 121 | 2016-06-01T10:55:42.000Z | 2022-03-10T15:32:36.000Z | src/pyvfx_boilerplate/mayapalette.py | nzanepro/pyvfx.boilerplate | 7e51e97836204c5ff18c3aef97684bd6253b719a | [
"MIT"
] | 16 | 2016-06-01T08:44:02.000Z | 2020-05-06T21:35:12.000Z | src/pyvfx_boilerplate/mayapalette.py | nzanepro/pyvfx.boilerplate | 7e51e97836204c5ff18c3aef97684bd6253b719a | [
"MIT"
] | 31 | 2016-06-03T14:40:10.000Z | 2022-02-24T21:30:03.000Z | import json
from Qt import QtGui
from Qt import QtWidgets
def set_palette_from_dict(dct):
"""Set palette to current QApplication based on given dictionary"""
groups = ["Disabled", "Active", "Inactive", "Normal"]
roles = [
"AlternateBase",
"Background",
"Base",
"Button",
... | 27.829787 | 74 | 0.623089 | import json
from Qt import QtGui
from Qt import QtWidgets
def set_palette_from_dict(dct):
groups = ["Disabled", "Active", "Inactive", "Normal"]
roles = [
"AlternateBase",
"Background",
"Base",
"Button",
"ButtonText",
"BrightText",
"Dark",
"Foreg... | true | true |
f70cc5a1bcdac716b4c8be3c121f38829038f099 | 4,520 | py | Python | scripts/pred_coinfo250.py | rdenaux/acred | ffe44953a96338acfe3860a9898e7f0b70b5c9cb | [
"Apache-2.0"
] | 8 | 2020-08-31T04:14:22.000Z | 2021-09-29T06:00:31.000Z | scripts/pred_coinfo250.py | expertailab/acred | ee45840c942ef2fac4f26da8d756b7c47e42847c | [
"Apache-2.0"
] | null | null | null | scripts/pred_coinfo250.py | expertailab/acred | ee45840c942ef2fac4f26da8d756b7c47e42847c | [
"Apache-2.0"
] | 1 | 2020-10-07T08:09:29.000Z | 2020-10-07T08:09:29.000Z | #
# 2020 ExpertSystem
#
'''Script for generating predictions for the coinform250 dataset
using the acred predictor
See https://github.com/co-inform/Datasets
See also scripts/fetch-data.sh, which should download the input json file
and place it in the `data/evaluation/` folder.
'''
import argparse
import time
import ... | 31.388889 | 98 | 0.593363 | import argparse
import time
import json
import os
import os.path as osp
import requests
import traceback
import pandas as pd
def ensure_req_tweet_content(req):
for t in req['tweets']:
c = t['content']
if c is None:
t['content'] = ''
print('Fixed null content')
def acred_as... | true | true |
f70cc5a478b36b0bfb1fa3944bb0bc5dcb9f1b14 | 2,147 | py | Python | bin/plotBandsWithOam.py | houchen-li/LhcVaspTools | ad7581cdfcd83741c6923b11f4d3257ee2494ce8 | [
"MIT"
] | null | null | null | bin/plotBandsWithOam.py | houchen-li/LhcVaspTools | ad7581cdfcd83741c6923b11f4d3257ee2494ce8 | [
"MIT"
] | null | null | null | bin/plotBandsWithOam.py | houchen-li/LhcVaspTools | ad7581cdfcd83741c6923b11f4d3257ee2494ce8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
from LhcVaspTools.BasicUtils import readDataFromJson
from LhcVaspTools.OamExts import EnergyBandsWithOam
def parseArgv() -> argparse.Namespace:
parser: argparse.ArgumentParser = argparse.ArgumentParser(
description="This script is used to plot bands")
parser.add_... | 43.816327 | 91 | 0.651141 |
import argparse
from LhcVaspTools.BasicUtils import readDataFromJson
from LhcVaspTools.OamExts import EnergyBandsWithOam
def parseArgv() -> argparse.Namespace:
parser: argparse.ArgumentParser = argparse.ArgumentParser(
description="This script is used to plot bands")
parser.add_argument("input_file_n... | true | true |
f70cc5d3d4ff2bd272d6b1d6d2c75dd4fb3381f8 | 83,466 | py | Python | zerver/tests/tests.py | tobby2002/zulip | 66e7c455759f9368bae16b9a604cf63f8e3524cd | [
"Apache-2.0"
] | 1 | 2017-07-27T19:49:12.000Z | 2017-07-27T19:49:12.000Z | zerver/tests/tests.py | tobby2002/localzulip | bfedd3f5686b91a5e332c96b4102b16c4e1b6fa9 | [
"Apache-2.0"
] | 8 | 2021-03-31T18:45:09.000Z | 2022-03-11T23:25:59.000Z | zerver/tests/tests.py | tobby2002/zulip | 66e7c455759f9368bae16b9a604cf63f8e3524cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any, Callable, Dict, Iterable, List, Mapping, Tuple, TypeVar
from mock import patch, MagicMock
from django.http import HttpResponse
from django.test import TestCase, override_settings
from zerver.l... | 39.149156 | 106 | 0.625177 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any, Callable, Dict, Iterable, List, Mapping, Tuple, TypeVar
from mock import patch, MagicMock
from django.http import HttpResponse
from django.test import TestCase, override_settings
from zerver.lib.test_helpers import (... | true | true |
f70cc5efd6ee30bf6e24e6413ae411d0d6938392 | 34 | py | Python | dataloader/__init__.py | sajith-rahim/transformer-classifier | 543562fc22a4ee3b224eaf44876449552026d2e5 | [
"Apache-2.0"
] | null | null | null | dataloader/__init__.py | sajith-rahim/transformer-classifier | 543562fc22a4ee3b224eaf44876449552026d2e5 | [
"Apache-2.0"
] | null | null | null | dataloader/__init__.py | sajith-rahim/transformer-classifier | 543562fc22a4ee3b224eaf44876449552026d2e5 | [
"Apache-2.0"
] | null | null | null | from .sentence_dataloader import * | 34 | 34 | 0.852941 | from .sentence_dataloader import * | true | true |
f70cc6649fea754647fe747bf5298e5f86180bb4 | 624 | py | Python | InkWarmReloadDemo.py | andycb/inkyWhatInfoDisplay | b05e2b2d5fc084298bb9ad1eeecaa7fd5eb6732f | [
"MIT"
] | 5 | 2019-11-05T08:32:44.000Z | 2022-01-01T19:12:20.000Z | InkWarmReloadDemo.py | andycb/inkyWhatInfoDisplay | b05e2b2d5fc084298bb9ad1eeecaa7fd5eb6732f | [
"MIT"
] | null | null | null | InkWarmReloadDemo.py | andycb/inkyWhatInfoDisplay | b05e2b2d5fc084298bb9ad1eeecaa7fd5eb6732f | [
"MIT"
] | null | null | null | import time
from inky_fork import InkyPHAT, InkyWHAT
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from datetime import datetime
from time import gmtime, strftime
inky_display = InkyWHAT("black_fast")
font = ImageFont.truetype("Nunito-ExtraLight.ttf", 130)
i = 10
while True:
image = I... | 24.96 | 69 | 0.725962 | import time
from inky_fork import InkyPHAT, InkyWHAT
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from datetime import datetime
from time import gmtime, strftime
inky_display = InkyWHAT("black_fast")
font = ImageFont.truetype("Nunito-ExtraLight.ttf", 130)
i = 10
while True:
image = I... | true | true |
f70cc668822045cd6d0fe8c43d30364a6c8ec638 | 267 | py | Python | Mundo 2 - Estruturas de Controle/#067 - Tabuada v3.0.py | Pedrohclelis/curso-em-video-python | 84e61ccec570fdf9546844757f99ca11333565a8 | [
"MIT"
] | null | null | null | Mundo 2 - Estruturas de Controle/#067 - Tabuada v3.0.py | Pedrohclelis/curso-em-video-python | 84e61ccec570fdf9546844757f99ca11333565a8 | [
"MIT"
] | null | null | null | Mundo 2 - Estruturas de Controle/#067 - Tabuada v3.0.py | Pedrohclelis/curso-em-video-python | 84e61ccec570fdf9546844757f99ca11333565a8 | [
"MIT"
] | null | null | null | while True:
n = int(input("Quer ver a tabuada de qual valor? "))
if n < 0:
print('-=' * 19)
print('PROGRAMA TABUADA ENCERRADO, VOLTE SEMPRE')
break
print('-=' * 19)
for c in range(1, 11):
print(f'{n} x {c:2} = {n*c:2}') | 29.666667 | 57 | 0.501873 | while True:
n = int(input("Quer ver a tabuada de qual valor? "))
if n < 0:
print('-=' * 19)
print('PROGRAMA TABUADA ENCERRADO, VOLTE SEMPRE')
break
print('-=' * 19)
for c in range(1, 11):
print(f'{n} x {c:2} = {n*c:2}') | true | true |
f70cc67d622524e48e5f02f581e211565a864500 | 27,384 | py | Python | lib/python3.8/site-packages/ansible_collections/community/general/plugins/modules/docker_network.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | 5 | 2020-12-16T21:42:09.000Z | 2022-03-28T16:04:32.000Z | .ansible/collections/ansible_collections/community/general/plugins/modules/cloud/docker/docker_network.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | .ansible/collections/ansible_collections/community/general/plugins/modules/cloud/docker/docker_network.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# 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
DOCUMENTATION = '''
module: docker_network
short_description: Manage Docker network... | 38.139276 | 159 | 0.620764 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: docker_network
short_description: Manage Docker networks
description:
- Create/remove Docker networks and connect containers to them.
- Performs largely the same function as the "docker network" CLI ... | true | true |
f70cc7139e0c240885f1ad904fb1b00d47ba34ff | 176 | py | Python | main.py | mohamadhayeri9/async | c63f2cb1532098ab2e115f90156cf073a99c0b85 | [
"MIT"
] | 1 | 2020-05-13T22:34:03.000Z | 2020-05-13T22:34:03.000Z | main.py | mohamadhayeri9/async | c63f2cb1532098ab2e115f90156cf073a99c0b85 | [
"MIT"
] | null | null | null | main.py | mohamadhayeri9/async | c63f2cb1532098ab2e115f90156cf073a99c0b85 | [
"MIT"
] | null | null | null | #!/uwsr/bin/env python3
import asyncio
async def main():
print('hello')
await asyncio.sleep(1)
print('world')
if __name__=="__main__":
asyncio.run(main())
| 12.571429 | 26 | 0.636364 |
import asyncio
async def main():
print('hello')
await asyncio.sleep(1)
print('world')
if __name__=="__main__":
asyncio.run(main())
| true | true |
f70cc72811e78a54aee8eb1e02a003cb5c2b56ec | 234 | py | Python | script/translations/const.py | fb22/home-assistant | a95ab9c8099e321a5be0e2d6689258ac9c262636 | [
"Apache-2.0"
] | null | null | null | script/translations/const.py | fb22/home-assistant | a95ab9c8099e321a5be0e2d6689258ac9c262636 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | script/translations/const.py | fb22/home-assistant | a95ab9c8099e321a5be0e2d6689258ac9c262636 | [
"Apache-2.0"
] | null | null | null | """Translation constants."""
import pathlib
PROJECT_ID = "130246255a974bd3b5e8a1.51616605"
DOCKER_IMAGE = "b8329d20280263cad04f65b843e54b9e8e6909a348a678eac959550b5ef5c75f"
INTEGRATIONS_DIR = pathlib.Path("homeassistant/components")
| 33.428571 | 81 | 0.850427 | import pathlib
PROJECT_ID = "130246255a974bd3b5e8a1.51616605"
DOCKER_IMAGE = "b8329d20280263cad04f65b843e54b9e8e6909a348a678eac959550b5ef5c75f"
INTEGRATIONS_DIR = pathlib.Path("homeassistant/components")
| true | true |
f70cc782bacfe72f2515177fe5c77a0649b22ebf | 568 | py | Python | app.py | josh91hickman/react_wiki | 4f38cf5edca567c1d04ec2d9184202a28f944c71 | [
"MIT"
] | null | null | null | app.py | josh91hickman/react_wiki | 4f38cf5edca567c1d04ec2d9184202a28f944c71 | [
"MIT"
] | null | null | null | app.py | josh91hickman/react_wiki | 4f38cf5edca567c1d04ec2d9184202a28f944c71 | [
"MIT"
] | null | null | null | import os
from flask import Flask, send_from_directory
app = Flask(__name__, static_folder='client/build')
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def serve(path):
if(path == ""):
return send_from_directory('client/build', 'index.html')
else:
if(os.path.exists("client... | 29.894737 | 68 | 0.647887 | import os
from flask import Flask, send_from_directory
app = Flask(__name__, static_folder='client/build')
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def serve(path):
if(path == ""):
return send_from_directory('client/build', 'index.html')
else:
if(os.path.exists("client... | true | true |
f70cc7c8d0a5ba28ecc472eecce5eb80c4c255cb | 7,321 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20181001/get_interface_endpoint.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20181001/get_interface_endpoint.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20181001/get_interface_endpoint.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # 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
from... | 36.788945 | 195 | 0.647179 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetInterfaceEndpointResult',
'AwaitableGetInterfaceEndpointResult',
'get_interface_endpoint',
]
@pulumi.output_type
class G... | true | true |
f70cc876c0a5e6490d4b69c5ac726c6a1c11137e | 1,546 | py | Python | try.py | GustavHenning/newsRef | bdd7f9a2e130bf4be25460e4614562b7aba6ae3d | [
"MIT"
] | null | null | null | try.py | GustavHenning/newsRef | bdd7f9a2e130bf4be25460e4614562b7aba6ae3d | [
"MIT"
] | null | null | null | try.py | GustavHenning/newsRef | bdd7f9a2e130bf4be25460e4614562b7aba6ae3d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyteaser import SummarizeUrl
from scipy import spatial
import re, math
from collections import Counter
#http://stackoverflow.com/questions/15173225/how-to-calculate-cosine-similarity-given-2-sentence-strings-python
WORD = re.compile(r'\w+')
def get_cosine(vec1, vec2)... | 26.655172 | 111 | 0.694049 | from pyteaser import SummarizeUrl
from scipy import spatial
import re, math
from collections import Counter
WORD = re.compile(r'\w+')
def get_cosine(vec1, vec2):
intersection = set(vec1.keys()) & set(vec2.keys())
numerator = sum([vec1[x] * vec2[x] for x in intersection])
sum1 = sum([vec1[x]**2 for x i... | false | true |
f70cc8f9c80c33b5721649fb0844c8267df4d7e6 | 1,415 | py | Python | cinderclient/tests/v2/test_snapshot_actions.py | Acidburn0zzz/python-cinderclient | a58e14fc4f33e1f1eea7aa4ced3cf8976cb112c2 | [
"Apache-1.1"
] | null | null | null | cinderclient/tests/v2/test_snapshot_actions.py | Acidburn0zzz/python-cinderclient | a58e14fc4f33e1f1eea7aa4ced3cf8976cb112c2 | [
"Apache-1.1"
] | null | null | null | cinderclient/tests/v2/test_snapshot_actions.py | Acidburn0zzz/python-cinderclient | a58e14fc4f33e1f1eea7aa4ced3cf8976cb112c2 | [
"Apache-1.1"
] | null | null | null | # Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 39.305556 | 78 | 0.640989 |
from cinderclient.tests import utils
from cinderclient.tests.v2 import fakes
cs = fakes.FakeClient()
class SnapshotActionsTest(utils.TestCase):
def test_update_snapshot_status(self):
s = cs.volume_snapshots.get('1234')
cs.volume_snapshots.update_snapshot_status(s,
... | true | true |
f70cc90ac14d2efe82f4953bbeee0424dfd60ea8 | 4,769 | py | Python | turbo_transformers/python/tests/bert_model_test.py | xcnick/TurboTransformers | 48b6ba09af2219616c6b97cc5c09222408e080c2 | [
"BSD-3-Clause"
] | null | null | null | turbo_transformers/python/tests/bert_model_test.py | xcnick/TurboTransformers | 48b6ba09af2219616c6b97cc5c09222408e080c2 | [
"BSD-3-Clause"
] | null | null | null | turbo_transformers/python/tests/bert_model_test.py | xcnick/TurboTransformers | 48b6ba09af2219616c6b97cc5c09222408e080c2 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2020 THL A29 Limited, a Tencent company.
# All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may
# not use this file except in compliance with the License. You may
# obtain a copy of the License at
# https://opensource.org/licenses/BSD-3-Clause
# Unless required by appl... | 40.07563 | 77 | 0.59698 |
import unittest
import torch
from transformers.modeling_bert import BertModel, BertConfig
import numpy
import turbo_transformers
import sys
import os
sys.path.append(os.path.dirname(__file__))
import test_helper
class TestBertModel(unittest.TestCase):
def init_data(self, use_cuda) -> None:
torch.set_gra... | true | true |
f70cc93d1680ca37f3c39292da32ba7f7276f062 | 2,903 | py | Python | panorama-commit-push.py | djspears/pythonscripts | f4795ade74da33d84b6b3db0a2792ebd48c9c3d5 | [
"Apache-2.0"
] | null | null | null | panorama-commit-push.py | djspears/pythonscripts | f4795ade74da33d84b6b3db0a2792ebd48c9c3d5 | [
"Apache-2.0"
] | null | null | null | panorama-commit-push.py | djspears/pythonscripts | f4795ade74da33d84b6b3db0a2792ebd48c9c3d5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014, Palo Alto Networks
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" A... | 36.2875 | 173 | 0.729935 |
__author__ = "djspears"
import argparse
from panos import panorama
def main():
parser = argparse.ArgumentParser(
description="Commit and Push an updated Panorama device group configuration"
)
parser.add_argument(
"-v", "--verbose", action="count", help="Verbose (-vv for extra ver... | true | true |
f70cc9b9c9627bc14e886c5c6f9138a31e34aa24 | 539 | py | Python | shortener/utils.py | Alexmhack/django_url_shorter | cbdad3b08db3558ba4383d29964f88e110b92119 | [
"MIT"
] | null | null | null | shortener/utils.py | Alexmhack/django_url_shorter | cbdad3b08db3558ba4383d29964f88e110b92119 | [
"MIT"
] | null | null | null | shortener/utils.py | Alexmhack/django_url_shorter | cbdad3b08db3558ba4383d29964f88e110b92119 | [
"MIT"
] | null | null | null | import random
import string
from django.conf import settings
SHORTCODE_MIN = getattr(settings, "SHORTCODE_MIN", 5)
def code_generator(size=SHORTCODE_MIN, chars=string.ascii_lowercase + string.digits + string.ascii_uppercase):
return ''.join(random.choice(chars) for _ in range(size))
def create_shortcode(instance,... | 28.368421 | 110 | 0.794063 | import random
import string
from django.conf import settings
SHORTCODE_MIN = getattr(settings, "SHORTCODE_MIN", 5)
def code_generator(size=SHORTCODE_MIN, chars=string.ascii_lowercase + string.digits + string.ascii_uppercase):
return ''.join(random.choice(chars) for _ in range(size))
def create_shortcode(instance,... | true | true |
f70ccb57b06d137684e4f325e080a29819d1a23b | 142 | py | Python | PATH/output_path.py | visionshao/TerminologyExtraction | ff23d7794e8bbfbc6c576fd5d46b37b40a652b67 | [
"MIT"
] | 1 | 2021-04-26T21:44:20.000Z | 2021-04-26T21:44:20.000Z | PATH/output_path.py | visionshao/TerminologyExtraction | ff23d7794e8bbfbc6c576fd5d46b37b40a652b67 | [
"MIT"
] | null | null | null | PATH/output_path.py | visionshao/TerminologyExtraction | ff23d7794e8bbfbc6c576fd5d46b37b40a652b67 | [
"MIT"
] | null | null | null | preprocess_output = r"D:\Codes\Wos_IE\result\content_dic.json"
abbreviate_dictionary_output = r"D:\Codes\Wos_IE\result\abbreviate_words.json" | 71 | 78 | 0.830986 | preprocess_output = r"D:\Codes\Wos_IE\result\content_dic.json"
abbreviate_dictionary_output = r"D:\Codes\Wos_IE\result\abbreviate_words.json" | true | true |
f70ccb789ed596cbf41c16f2b9fc5b16434f8026 | 3,307 | py | Python | ClassificationOnIrisDataset/solution.py | grehujt/SmallPythonProjects | 5e6ca01935a0f209330bf0a92d4c053465dd8d9d | [
"MIT"
] | null | null | null | ClassificationOnIrisDataset/solution.py | grehujt/SmallPythonProjects | 5e6ca01935a0f209330bf0a92d4c053465dd8d9d | [
"MIT"
] | null | null | null | ClassificationOnIrisDataset/solution.py | grehujt/SmallPythonProjects | 5e6ca01935a0f209330bf0a92d4c053465dd8d9d | [
"MIT"
] | null | null | null |
# coding: utf-8
from itertools import combinations
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.cross_validation import KFold
data = load_iris()
for k, v in data.items():
print k
print v, '\n'
featureNames = data['feature_names']
features = data['data']
targetNames = ... | 29.265487 | 108 | 0.620804 |
from itertools import combinations
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.cross_validation import KFold
data = load_iris()
for k, v in data.items():
print k
print v, '\n'
featureNames = data['feature_names']
features = data['data']
targetNames = data['target_nam... | false | true |
f70ccd30d2b618720439af87f1cbf9a0e6f3a904 | 2,541 | py | Python | tools/accuracy_checker/accuracy_checker/annotation_converters/cluttered_mnist.py | evgeny-izutov/open_model_zoo | 2cd6145ef342fc9b7ccf32676af73f4a1cb8d9ba | [
"Apache-2.0"
] | 4 | 2019-09-17T13:11:02.000Z | 2021-02-22T15:39:15.000Z | tools/accuracy_checker/accuracy_checker/annotation_converters/cluttered_mnist.py | evgeny-izutov/open_model_zoo | 2cd6145ef342fc9b7ccf32676af73f4a1cb8d9ba | [
"Apache-2.0"
] | null | null | null | tools/accuracy_checker/accuracy_checker/annotation_converters/cluttered_mnist.py | evgeny-izutov/open_model_zoo | 2cd6145ef342fc9b7ccf32676af73f4a1cb8d9ba | [
"Apache-2.0"
] | 1 | 2022-01-12T03:47:00.000Z | 2022-01-12T03:47:00.000Z | """
Copyright (c) 2018-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | 40.983871 | 112 | 0.68477 |
from PIL import Image
import numpy as np
from .format_converter import BaseFormatConverter, ConverterReturn
from ..config import PathField, StringField, BoolField
from ..representation import ClassificationAnnotation
class ClutteredMNISTConverter(BaseFormatConverter):
__provider__ = 'cluttered_mnist'
@class... | true | true |
f70ccd3f592caa16b7fa06c4c3e16ed23cb032f2 | 514 | py | Python | migrations/versions/ee248674f637_.py | halonotes/personal_blog | 05d03ec6d595b6b92296dfed23f168f0932ce660 | [
"MIT"
] | null | null | null | migrations/versions/ee248674f637_.py | halonotes/personal_blog | 05d03ec6d595b6b92296dfed23f168f0932ce660 | [
"MIT"
] | null | null | null | migrations/versions/ee248674f637_.py | halonotes/personal_blog | 05d03ec6d595b6b92296dfed23f168f0932ce660 | [
"MIT"
] | null | null | null | """empty message
Revision ID: ee248674f637
Revises: ebf728dc4d0d
Create Date: 2017-05-31 15:07:32.715000
"""
# revision identifiers, used by Alembic.
revision = 'ee248674f637'
down_revision = 'ebf728dc4d0d'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic ... | 19.037037 | 65 | 0.678988 |
revision = 'ee248674f637'
down_revision = 'ebf728dc4d0d'
from alembic import op
import sqlalchemy as sa
def upgrade():
pass
def downgrade():
pass
| true | true |
f70ccd88b76265237437e8e41db9cb8a098c6294 | 32,347 | py | Python | empress/tree.py | esayyari/empress | 092044d4444a1569784cd9d336eb2a2a44a92abc | [
"Apache-2.0",
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | empress/tree.py | esayyari/empress | 092044d4444a1569784cd9d336eb2a2a44a92abc | [
"Apache-2.0",
"CC0-1.0",
"BSD-3-Clause"
] | 1 | 2019-11-18T20:38:12.000Z | 2019-11-18T20:38:12.000Z | empress/tree.py | esayyari/empress | 092044d4444a1569784cd9d336eb2a2a44a92abc | [
"Apache-2.0",
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, empress development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 40.739295 | 94 | 0.56234 |
import warnings
from skbio import TreeNode
import numpy as np
from bp import BP, from_skbio_treenode
class TreeFormatWarning(Warning):
pass
class Tree:
def __init__(self, bp_tree):
self.bp_tree = bp_tree
self.B = self.bp_tree.B
self.leafcounts = np.zeros(self.B.size, np.int)
... | true | true |
f70cce9cf8e6f94035a97f0bd5920eba56414d69 | 25,988 | py | Python | nmt/model_helper.py | luckmoon/nmt | 4f6a4acf8d8e086f9d894444a2877ac1f0856ad0 | [
"Apache-2.0"
] | null | null | null | nmt/model_helper.py | luckmoon/nmt | 4f6a4acf8d8e086f9d894444a2877ac1f0856ad0 | [
"Apache-2.0"
] | null | null | null | nmt/model_helper.py | luckmoon/nmt | 4f6a4acf8d8e086f9d894444a2877ac1f0856ad0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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 required by applicable law or a... | 39.138554 | 86 | 0.642951 |
from __future__ import print_function
import collections
import os
import time
import numpy as np
import six
import tensorflow as tf
from tensorflow.python.ops import lookup_ops
from .utils import iterator_utils
from .utils import misc_utils as utils
from .utils import vocab_utils
__all__ = [
"get_initializer",... | true | true |
f70ccecb7e0a0402aa2a3f38c974fe76c305bdb8 | 5,559 | py | Python | script/workbench/TGS_salt/pretrain_Unet.py | demetoir/MLtools | 8c42fcd4cc71728333d9c116ade639fe57d50d37 | [
"MIT"
] | null | null | null | script/workbench/TGS_salt/pretrain_Unet.py | demetoir/MLtools | 8c42fcd4cc71728333d9c116ade639fe57d50d37 | [
"MIT"
] | null | null | null | script/workbench/TGS_salt/pretrain_Unet.py | demetoir/MLtools | 8c42fcd4cc71728333d9c116ade639fe57d50d37 | [
"MIT"
] | null | null | null | import numpy as np
from tqdm import tqdm, trange
from script.data_handler.Base.BaseDataset import BaseDataset
from script.model.sklearn_like_model.BaseModel import BaseModel
from script.model.sklearn_like_model.Mixin import UnsupervisedMetricCallback
from script.model.sklearn_like_model.NetModule.BaseNetModule imp... | 34.52795 | 98 | 0.61288 | import numpy as np
from tqdm import tqdm, trange
from script.data_handler.Base.BaseDataset import BaseDataset
from script.model.sklearn_like_model.BaseModel import BaseModel
from script.model.sklearn_like_model.Mixin import UnsupervisedMetricCallback
from script.model.sklearn_like_model.NetModule.BaseNetModule imp... | true | true |
f70ccef9cd35c768a2257cab5fc3c2d3f8ada73b | 5,332 | py | Python | mask r-cnn/evaluation.py | bharatmahaur/ComparativeStudy | 2e3b6de882acc2a465e1b7c8bcd23cc9c8181d3d | [
"Apache-2.0"
] | 5 | 2021-09-26T07:19:42.000Z | 2022-03-11T23:25:36.000Z | mask r-cnn/evaluation.py | bharatmahaur/ComparativeStudy | 2e3b6de882acc2a465e1b7c8bcd23cc9c8181d3d | [
"Apache-2.0"
] | null | null | null | mask r-cnn/evaluation.py | bharatmahaur/ComparativeStudy | 2e3b6de882acc2a465e1b7c8bcd23cc9c8181d3d | [
"Apache-2.0"
] | null | null | null | """
# Train a new model starting from pre-trained weights
python3 training.py --dataset=/path/to/dataset --weight=/path/to/pretrained/weight.h5
# Resume training a model
python3 training.py --dataset=/path/to/dataset --continue_train=/path/to/latest/weights.h5
"""
import logging
import warnings
import ... | 31 | 112 | 0.597337 |
import logging
import warnings
import os
logging.getLogger("tensorflow").setLevel(logging.ERROR)
warnings.filterwarnings('ignore')
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
import sys
import json
import datetime
import numpy as np
import skimage.draw
impo... | true | true |
f70ccfa334a29d3f84bfc3a580de91f8a135b6c9 | 16,978 | py | Python | elastic/datadog_checks/elastic/elastic.py | idarlington/integrations-core | 0d323ef4c3af18acec2b681f5389326257b45c1e | [
"BSD-3-Clause"
] | null | null | null | elastic/datadog_checks/elastic/elastic.py | idarlington/integrations-core | 0d323ef4c3af18acec2b681f5389326257b45c1e | [
"BSD-3-Clause"
] | 2 | 2021-04-26T13:37:48.000Z | 2021-04-26T13:37:49.000Z | elastic/datadog_checks/elastic/elastic.py | idarlington/integrations-core | 0d323ef4c3af18acec2b681f5389326257b45c1e | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import time
from collections import defaultdict
import requests
from six import iteritems, itervalues
from six.moves.urllib.parse import urljoin, urlparse
from datadog_checks.base import AgentCheck, is_affirma... | 41.309002 | 112 | 0.607963 | import time
from collections import defaultdict
import requests
from six import iteritems, itervalues
from six.moves.urllib.parse import urljoin, urlparse
from datadog_checks.base import AgentCheck, is_affirmative, to_string
from .config import from_instance
from .metrics import (
CLUSTER_PENDING_TASKS,
heal... | true | true |
f70cd102871d0a2b4ab9d248f4fe7f91a22d9fd8 | 2,833 | py | Python | userman/uimodules.py | aanil/userman | c4b09a8183a01da6e4b0402be4da3bde88eada5c | [
"MIT"
] | null | null | null | userman/uimodules.py | aanil/userman | c4b09a8183a01da6e4b0402be4da3bde88eada5c | [
"MIT"
] | null | null | null | userman/uimodules.py | aanil/userman | c4b09a8183a01da6e4b0402be4da3bde88eada5c | [
"MIT"
] | 2 | 2019-08-14T08:33:14.000Z | 2020-01-30T14:13:57.000Z | " Userman: UI modules. "
import tornado.web
from . import constants
class Icon(tornado.web.UIModule):
"HTML for an icon, optionally labelled with a title."
template = """<img src="{url}" class="icon" alt="{alt}" title="{title}">"""
def render(self, name, title=None, label=False):
if not isinst... | 28.33 | 80 | 0.560537 |
import tornado.web
from . import constants
class Icon(tornado.web.UIModule):
template = """<img src="{url}" class="icon" alt="{alt}" title="{title}">"""
def render(self, name, title=None, label=False):
if not isinstance(name, basestring):
name = name[constants.DB_DOCTYPE]
Name ... | true | true |
f70cd157208600d80c321cc62075315fca2dedd4 | 1,453 | py | Python | Loop_Induced_Vertices/coupling_orders.py | ycwu1030/2HDM_FR | 599490fd785cb67e3e4ffad1fa7536906ac8bcd5 | [
"MIT"
] | 1 | 2019-09-04T01:44:29.000Z | 2019-09-04T01:44:29.000Z | Loop_Induced_Vertices/coupling_orders.py | ycwu1030/2HDM_FR | 599490fd785cb67e3e4ffad1fa7536906ac8bcd5 | [
"MIT"
] | null | null | null | Loop_Induced_Vertices/coupling_orders.py | ycwu1030/2HDM_FR | 599490fd785cb67e3e4ffad1fa7536906ac8bcd5 | [
"MIT"
] | null | null | null |
NLOT = CouplingOrder(name = 'NLOT', # ggS triangle nlo couplings
expansion_order = 1,
hierarchy = 2)
NLOTHL = CouplingOrder(name = 'NLOTHL', # ggS triangle nlo couplings for HL
expansion_order = 1,
hierarchy = 2)
NLOTHH = CouplingOrder(n... | 35.439024 | 75 | 0.527185 |
NLOT = CouplingOrder(name = 'NLOT', expansion_order = 1,
hierarchy = 2)
NLOTHL = CouplingOrder(name = 'NLOTHL', expansion_order = 1,
hierarchy = 2)
NLOTHH = CouplingOrder(name = 'NLOTHH', expansion_order = 1,
... | true | true |
f70cd2afa555b4dcfd07279b863b47a27fa4da23 | 25,532 | py | Python | backend/lib/grpc/_server.py | isaiah-solo/Droptalk | 578a647adceecfae9d30ca6b98fdaae7077d683f | [
"MIT"
] | null | null | null | backend/lib/grpc/_server.py | isaiah-solo/Droptalk | 578a647adceecfae9d30ca6b98fdaae7077d683f | [
"MIT"
] | null | null | null | backend/lib/grpc/_server.py | isaiah-solo/Droptalk | 578a647adceecfae9d30ca6b98fdaae7077d683f | [
"MIT"
] | null | null | null | # Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 33.727873 | 85 | 0.721722 |
import collections
import enum
import logging
import threading
import time
import grpc
from grpc import _common
from grpc._cython import cygrpc
from grpc.framework.foundation import callable_util
_SHUTDOWN_TAG = 'shutdown'
_REQUEST_CALL_TAG = 'request_call'
_RECEIVE_CLOSE_ON_SERVER_TOKEN = 'receive_close_on_server... | true | true |
f70cd34424661c462973e9a8f65d8066ae8d1cf4 | 756 | py | Python | var/spack/repos/builtin/packages/libxevie/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/libxevie/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/libxevie/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libxevie(AutotoolsPackage, XorgPackage):
"""Xevie - X Event Interception Extension (XEvIE)... | 30.24 | 95 | 0.72619 |
from spack import *
class Libxevie(AutotoolsPackage, XorgPackage):
homepage = "https://cgit.freedesktop.org/xorg/lib/libXevie"
xorg_mirror_path = "lib/libXevie-1.0.3.tar.gz"
version('1.0.3', sha256='3759bb1f7fdade13ed99bfc05c0717bc42ce3f187e7da4eef80beddf5e461258')
depends_on('libx11')
depends... | true | true |
f70cd36f728286c806355f96ef79cdda124c1004 | 2,713 | py | Python | app/recipe/tests/test_ingredients_api.py | alyssonDeAssis/recipe-app-api | 00bc48afbf598ecf981a96c61535683c915946fb | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredients_api.py | alyssonDeAssis/recipe-app-api | 00bc48afbf598ecf981a96c61535683c915946fb | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredients_api.py | alyssonDeAssis/recipe-app-api | 00bc48afbf598ecf981a96c61535683c915946fb | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe:ingred... | 31.917647 | 78 | 0.686694 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe:ingred... | true | true |
f70cd3ca35aac69835bd12a3ca1e659ecd71a94e | 388 | py | Python | files/lickeeper.py | xoosite/ido.py | 811d6477560fc5f635a4d1c8817f4a4667e6c251 | [
"MIT"
] | null | null | null | files/lickeeper.py | xoosite/ido.py | 811d6477560fc5f635a4d1c8817f4a4667e6c251 | [
"MIT"
] | null | null | null | files/lickeeper.py | xoosite/ido.py | 811d6477560fc5f635a4d1c8817f4a4667e6c251 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
#=============================================================================
# FileName: lickeeper.py
# Desc:
# Author: Jeyrce.Lu
# Email: jianxin.lu@woqutech.com
# HomePage: www.woqutech.com
# Version: 0.0.1
# LastChange: 2021/1/13 上午11:18
# History:
#==============... | 25.866667 | 78 | 0.384021 | true | true | |
f70cd53a0ab1a7e8ce5258207595405255bcc6d9 | 1,343 | py | Python | gandyloo/connection.py | kazimuth/gandyloo | caa3ae360b5498b147281cc59973f7da3069dfdd | [
"MIT"
] | 2 | 2015-11-10T20:42:51.000Z | 2021-12-10T07:50:37.000Z | gandyloo/connection.py | kazimuth/gandyloo | caa3ae360b5498b147281cc59973f7da3069dfdd | [
"MIT"
] | null | null | null | gandyloo/connection.py | kazimuth/gandyloo | caa3ae360b5498b147281cc59973f7da3069dfdd | [
"MIT"
] | null | null | null | from twisted.internet.protocol import Protocol
from gandyloo import parse
class MinesweeperClient(Protocol):
'''Represents a connection to a server using twisted's Protocol framework.
Created with an event sink, where parsed events (subclasses of
gandyloo.message.Response) are fired. Sink should have a met... | 31.97619 | 78 | 0.636634 | from twisted.internet.protocol import Protocol
from gandyloo import parse
class MinesweeperClient(Protocol):
def __init__(self, event_sink):
self.buffer = ""
self.hello_received = False
self.size = None
self.event_sink = event_sink
def dataReceived(self, data):
self.bu... | true | true |
f70cd5999a4ccff18cd0e1d6ac5ea0040faf88ed | 655 | py | Python | tests/core/fixtures/features.py | jsam/datagears | d2400f20069898a959fbe182931faba1c90b7181 | [
"BSD-3-Clause"
] | 3 | 2020-11-09T00:05:59.000Z | 2021-03-31T11:30:22.000Z | tests/core/fixtures/features.py | jsam/datagears | d2400f20069898a959fbe182931faba1c90b7181 | [
"BSD-3-Clause"
] | 28 | 2020-11-12T14:56:21.000Z | 2022-03-07T11:07:08.000Z | tests/core/fixtures/features.py | jsam/datagears | d2400f20069898a959fbe182931faba1c90b7181 | [
"BSD-3-Clause"
] | 1 | 2021-04-03T14:35:19.000Z | 2021-04-03T14:35:19.000Z | import pytest
from datagears.core.network import Network
@pytest.fixture
def myfeature() -> Network:
"""Testing fixture for a feature."""
from datagears.core.network import Network
from datagears.features.dummy import my_out
network = Network("my-network", outputs=[my_out])
return network
@pyt... | 26.2 | 83 | 0.734351 | import pytest
from datagears.core.network import Network
@pytest.fixture
def myfeature() -> Network:
from datagears.core.network import Network
from datagears.features.dummy import my_out
network = Network("my-network", outputs=[my_out])
return network
@pytest.fixture
def store_feature() -> Networ... | true | true |
f70cd67da850213462cc6e238f500b2e7885ed5b | 6,296 | py | Python | curriculums.py | MrTornado24/FENeRF | 9d90acda243b7c7d7f2c688a3bb333da2e7f8894 | [
"MIT"
] | 22 | 2022-03-18T16:29:04.000Z | 2022-03-31T12:17:55.000Z | curriculums.py | MrTornado24/FENeRF | 9d90acda243b7c7d7f2c688a3bb333da2e7f8894 | [
"MIT"
] | 2 | 2022-03-28T09:21:27.000Z | 2022-03-28T09:30:16.000Z | curriculums.py | MrTornado24/FENeRF | 9d90acda243b7c7d7f2c688a3bb333da2e7f8894 | [
"MIT"
] | 1 | 2022-03-20T14:15:11.000Z | 2022-03-20T14:15:11.000Z | from generators.neural_rendering import NeuralRenderer
import math
def next_upsample_step(curriculum, current_step):
# Return the epoch when it will next upsample
current_metadata = extract_metadata(curriculum, current_step)
current_size = current_metadata['img_size']
for curriculum_step in sorted([cs ... | 35.173184 | 143 | 0.642471 | from generators.neural_rendering import NeuralRenderer
import math
def next_upsample_step(curriculum, current_step):
current_metadata = extract_metadata(curriculum, current_step)
current_size = current_metadata['img_size']
for curriculum_step in sorted([cs for cs in curriculum.keys() if type(cs) == int... | true | true |
f70cd699c1c3b6d728e49d2f94fc7cd65520d19c | 856 | py | Python | vnpy/app/option_master/time.py | xiumingxu/vnpy-xx | 8b2d9ecdabcb7931d46fd92fad2d3701b7e66975 | [
"MIT"
] | null | null | null | vnpy/app/option_master/time.py | xiumingxu/vnpy-xx | 8b2d9ecdabcb7931d46fd92fad2d3701b7e66975 | [
"MIT"
] | null | null | null | vnpy/app/option_master/time.py | xiumingxu/vnpy-xx | 8b2d9ecdabcb7931d46fd92fad2d3701b7e66975 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import trading_calendars
ANNUAL_DAYS = 240
# Get public holidays data from Shanghai Stock Exchange
cn_calendar = trading_calendars.get_calendar('XSHG')
holidays = [x.to_pydatetime() for x in cn_calendar.precomputed_holidays]
# Filter future public holidays
start = datetime.t... | 24.457143 | 82 | 0.685748 | from datetime import datetime, timedelta
import trading_calendars
ANNUAL_DAYS = 240
cn_calendar = trading_calendars.get_calendar('XSHG')
holidays = [x.to_pydatetime() for x in cn_calendar.precomputed_holidays]
start = datetime.today()
PUBLIC_HOLIDAYS = [x for x in holidays if x >= start]
def calculate_days_to_exp... | true | true |
f70cd6cdb85b3472a4bda270047affb6c4255059 | 4,588 | py | Python | server/scripts/services.py | anarkrypto/nano-dpow | 339452bf312bd336b493f7dc56370adf31cab219 | [
"MIT"
] | 35 | 2019-06-09T12:43:06.000Z | 2022-03-26T21:06:13.000Z | server/scripts/services.py | anarkrypto/nano-dpow | 339452bf312bd336b493f7dc56370adf31cab219 | [
"MIT"
] | 32 | 2019-06-10T00:01:08.000Z | 2022-03-11T23:53:16.000Z | server/scripts/services.py | anarkrypto/nano-dpow | 339452bf312bd336b493f7dc56370adf31cab219 | [
"MIT"
] | 22 | 2019-06-09T15:13:23.000Z | 2021-09-10T17:15:27.000Z | #!/usr/bin/env python3
import redis
import argparse
import hashlib
from getpass import getpass
r = redis.StrictRedis(host="localhost", port=6379)
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--add', action='store_true', help='Adds a service')
group... | 27.309524 | 93 | 0.602223 |
import redis
import argparse
import hashlib
from getpass import getpass
r = redis.StrictRedis(host="localhost", port=6379)
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--add', action='store_true', help='Adds a service')
group.add_argument('--check'... | true | true |
f70cd7a8ef49505ac83f768d0974b524ed21ae3f | 3,867 | py | Python | bindings/python/examples/SequenceClassification/SequenceClassification.py | KeDengMS/CNTK | fce86cd9581e7ba746d1ec75bbd67dd35d35d11c | [
"RSA-MD"
] | 1 | 2021-05-09T01:37:49.000Z | 2021-05-09T01:37:49.000Z | bindings/python/examples/SequenceClassification/SequenceClassification.py | KeDengMS/CNTK | fce86cd9581e7ba746d1ec75bbd67dd35d35d11c | [
"RSA-MD"
] | null | null | null | bindings/python/examples/SequenceClassification/SequenceClassification.py | KeDengMS/CNTK | fce86cd9581e7ba746d1ec75bbd67dd35d35d11c | [
"RSA-MD"
] | null | null | null | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import numpy as np
import sys
import os
import time
from cntk import Trainer, Axis,... | 37.182692 | 133 | 0.721748 |
import numpy as np
import sys
import os
import time
from cntk import Trainer, Axis, text_format_minibatch_source, StreamConfiguration
from cntk.device import cpu, set_default_device
from cntk.learner import sgd
from cntk.ops import input_variable, cross_entropy_with_softmax, combine, classification_error
abs_path = ... | true | true |
f70cd9631c838d6b5a85dc7b7a8ae17002d338e1 | 151 | py | Python | sindec/views/home.py | fcgomes92/com231-tf-sindec | e8654ac9875ba630464537957e16fbfcde7be28c | [
"MIT"
] | null | null | null | sindec/views/home.py | fcgomes92/com231-tf-sindec | e8654ac9875ba630464537957e16fbfcde7be28c | [
"MIT"
] | 8 | 2021-02-08T20:17:31.000Z | 2022-03-11T23:13:09.000Z | sindec/views/home.py | fcgomes92/com231-tf-sindec | e8654ac9875ba630464537957e16fbfcde7be28c | [
"MIT"
] | null | null | null | from django.views.generic import TemplateView
class HomeRequestView(TemplateView):
http_method_names = ['get', ]
template_name = "home.html"
| 21.571429 | 45 | 0.748344 | from django.views.generic import TemplateView
class HomeRequestView(TemplateView):
http_method_names = ['get', ]
template_name = "home.html"
| true | true |
f70cd9abb296e308c348eae7ed257ca62c1e6094 | 2,161 | py | Python | auxiliar.py | gustavoeso/img_manipulation | a2f46d46f1111ddf77b3d58cb5322ffbf591ea53 | [
"MIT"
] | 2 | 2022-03-08T20:55:38.000Z | 2022-03-09T19:16:10.000Z | Scripts/Filtragem e contorno jupyter/auxiliar.py | pcliquet/robotic_resumo | 3d1d8705820cae39d5be956836a94c7884ab490d | [
"MIT"
] | null | null | null | Scripts/Filtragem e contorno jupyter/auxiliar.py | pcliquet/robotic_resumo | 3d1d8705820cae39d5be956836a94c7884ab490d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Atenção: usado no notebook da aula.
Não precisa ser usado diretamente
"""
print("Este script não deve ser executado diretamente")
from ipywidgets import widgets, interact, interactive, FloatSlider, IntSlider
import numpy as np
import cv2
def make_widgets_mat... | 22.278351 | 77 | 0.589079 |
print("Este script não deve ser executado diretamente")
from ipywidgets import widgets, interact, interactive, FloatSlider, IntSlider
import numpy as np
import cv2
def make_widgets_mat(m, n):
list_elements = []
for i in range(m):
row = []
for j in range(n):
row.append(widgets.... | true | true |
f70cdac9dceaedf6c2a150c0ba9bac822f448f8f | 16,112 | py | Python | layouts_oilProd.py | jmcdowell26/TXRRC_data_harvest | 10dc94ef7b7ba6a8675b9b0430b660b9a0f5f6d5 | [
"Unlicense"
] | 26 | 2020-07-21T04:20:00.000Z | 2022-03-25T01:12:19.000Z | layouts_oilProd.py | jmcdowell26/TXRRC_data_harvest | 10dc94ef7b7ba6a8675b9b0430b660b9a0f5f6d5 | [
"Unlicense"
] | 19 | 2020-07-17T17:23:08.000Z | 2021-03-03T14:19:01.000Z | layouts_oilProd.py | jmcdowell26/TXRRC_data_harvest | 10dc94ef7b7ba6a8675b9b0430b660b9a0f5f6d5 | [
"Unlicense"
] | 13 | 2020-07-18T13:20:48.000Z | 2022-01-13T23:23:05.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 11:12:44 2020
Files for this layout:
ftp://ftpe.rrc.texas.gov/sholed
ftp://ftpe.rrc.texas.gov/sholed/olf001l.ebc.gz
ftp://ftpe.rrc.texas.gov/sholed/olf003l.ebc.gz
ftp://ftpe.rrc.texas.gov/sholed/olf004l.ebc.gz
ftp://ftpe.rrc.texas.go... | 59.235294 | 209 | 0.455561 |
OIL_FIELD_01 = [
('TYPE-REC',0,1,'pic_numeric'), ('DIST',1,3,'pic_any'), ('FIELD',4,8,'pic_numeric'), ('OPR',12,6,'pic_numeric'), ('LEASE',18,5,'pic_numeric'), ('LEASE FILLER',23,2,'pic_numeric'), ('OF... | true | true |
f70cdafe08c975c4847f2ad36db208c8169a9f3e | 1,841 | py | Python | claib_cam.py | m4xst3r/Udacity-AdvancedLaneLines | c95a1831a418726ad374a1ebd65d4ec5e9900ab9 | [
"MIT"
] | null | null | null | claib_cam.py | m4xst3r/Udacity-AdvancedLaneLines | c95a1831a418726ad374a1ebd65d4ec5e9900ab9 | [
"MIT"
] | null | null | null | claib_cam.py | m4xst3r/Udacity-AdvancedLaneLines | c95a1831a418726ad374a1ebd65d4ec5e9900ab9 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib.pyplot as plt
import glob
import pickle
# read in all the images in the calibration folder
calib_images = glob.glob(".\camera_cal\*.jpg")
#define chess board parameters:
nx = 9
ny = 6
# Arrays to store image point and opbject points
imgpoints = []
objpoints = []
def g... | 29.222222 | 150 | 0.693645 | import cv2
import numpy as np
import matplotlib.pyplot as plt
import glob
import pickle
calib_images = glob.glob(".\camera_cal\*.jpg")
nx = 9
ny = 6
imgpoints = []
objpoints = []
def get_points_chessboard(img, nx, ny):
objp = np.zeros((nx*ny,3), np.float32)
objp[:,:2] = np.mgrid[0:nx,0:ny].T.reshape... | true | true |
f70cdb7d010435165a57a0c040d4ec0555cc7980 | 3,636 | py | Python | scieloopds/__init__.py | scieloorg/scielo-opds | e7e6b2ae4b0817c7b3b395cc45ca24c8b9039353 | [
"Unlicense"
] | 4 | 2015-04-15T22:52:51.000Z | 2022-03-31T13:23:59.000Z | scieloopds/__init__.py | DalavanCloud/scielo-opds | e7e6b2ae4b0817c7b3b395cc45ca24c8b9039353 | [
"Unlicense"
] | 2 | 2016-02-29T18:49:12.000Z | 2021-03-31T18:31:50.000Z | scieloopds/__init__.py | DalavanCloud/scielo-opds | e7e6b2ae4b0817c7b3b395cc45ca24c8b9039353 | [
"Unlicense"
] | 1 | 2019-03-16T04:43:35.000Z | 2019-03-16T04:43:35.000Z | # coding: utf-8
"""
.. module: scieloopds
:synopsis: WSGI Application to provide SciELO Books in OPDS protocol.
.. moduleauthor:: Allison Vollmann <allisonvoll@gmail.com>
Example configuration (aditional parameters):
.. note::
[app:main]
...
mongo_uri = mongodb://localhost:27017/scieloopds
scielo_uri =... | 30.813559 | 80 | 0.671067 | import os
import sys
import logging
from urlparse import urlparse
from datetime import datetime, timedelta
import pymongo
from pyramid.config import Configurator
from pyramid.events import NewRequest
from pyramid.settings import asbool
from .sync import main as do_sync
from .utils import get_db_connection
APP_PATH ... | true | true |
f70cdbc2ed72ded8a04ad93f202362e377a20136 | 11,312 | py | Python | futu/quote/quote_response_handler.py | larryhou/py-futu-api | 9a05b801dac9f15ccf6c49ae08e7eabdbb4c7192 | [
"Apache-2.0"
] | 2 | 2020-03-18T09:54:03.000Z | 2020-05-15T08:13:33.000Z | futu/quote/quote_response_handler.py | larryhou/py-futu-api | 9a05b801dac9f15ccf6c49ae08e7eabdbb4c7192 | [
"Apache-2.0"
] | null | null | null | futu/quote/quote_response_handler.py | larryhou/py-futu-api | 9a05b801dac9f15ccf6c49ae08e7eabdbb4c7192 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pandas as pd
from futu.common import RspHandlerBase
from futu.quote.quote_query import *
class StockQuoteHandlerBase(RspHandlerBase):
"""
异步处理推送的订阅股票的报价。
.. code:: python
class StockQuoteTest(StockQuoteHandlerBase):
def on_recv_rsp(self, rsp_str):
... | 30.73913 | 121 | 0.592291 | import pandas as pd
from futu.common import RspHandlerBase
from futu.quote.quote_query import *
class StockQuoteHandlerBase(RspHandlerBase):
"""
异步处理推送的订阅股票的报价。
.. code:: python
class StockQuoteTest(StockQuoteHandlerBase):
def on_recv_rsp(self, rsp_str):
ret_code, co... | false | true |
f70cdc58f3bab9c011738c42991e61f6e7f48ee7 | 10,593 | py | Python | main/tests/test_management.py | geoah/mataroa | 5646af778bca8625b2d5efa4ebcfbe69a5f7dd12 | [
"MIT"
] | null | null | null | main/tests/test_management.py | geoah/mataroa | 5646af778bca8625b2d5efa4ebcfbe69a5f7dd12 | [
"MIT"
] | null | null | null | main/tests/test_management.py | geoah/mataroa | 5646af778bca8625b2d5efa4ebcfbe69a5f7dd12 | [
"MIT"
] | null | null | null | from datetime import datetime
from io import StringIO
from unittest.mock import patch
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.test import TestCase
from django.utils import timezone
from main import models
from main.management.commands i... | 35.787162 | 88 | 0.616634 | from datetime import datetime
from io import StringIO
from unittest.mock import patch
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.test import TestCase
from django.utils import timezone
from main import models
from main.management.commands i... | true | true |
f70cdc7487d74f04b362aa3575ebac9864924375 | 6,777 | py | Python | python3/koans/about_attribute_access.py | adrianhryn/Python_Koans | e5ec28939ac4cf7e91e470d9545ef7365fef4077 | [
"MIT"
] | null | null | null | python3/koans/about_attribute_access.py | adrianhryn/Python_Koans | e5ec28939ac4cf7e91e470d9545ef7365fef4077 | [
"MIT"
] | null | null | null | python3/koans/about_attribute_access.py | adrianhryn/Python_Koans | e5ec28939ac4cf7e91e470d9545ef7365fef4077 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Partially based on AboutMessagePassing in the Ruby Koans
#
from runner.koan import *
class AboutAttributeAccess(Koan):
class TypicalObject:
pass
def test_calling_undefined_functions_normally_results_in_errors(self):
typical = self.TypicalOb... | 32.118483 | 119 | 0.607053 |
from runner.koan import *
class AboutAttributeAccess(Koan):
class TypicalObject:
pass
def test_calling_undefined_functions_normally_results_in_errors(self):
typical = self.TypicalObject()
with self.assertRaises(AttributeError): typical.foobar()
def test_calling_getattribute_c... | true | true |
f70cddb894741e5d4601556682226a7d025c1177 | 407 | py | Python | tasks/__init__.py | jhrcook/awesome-streamlit | 83c4c4ec13f274b30e586715bb080e01432b87e6 | [
"CC0-1.0"
] | null | null | null | tasks/__init__.py | jhrcook/awesome-streamlit | 83c4c4ec13f274b30e586715bb080e01432b87e6 | [
"CC0-1.0"
] | null | null | null | tasks/__init__.py | jhrcook/awesome-streamlit | 83c4c4ec13f274b30e586715bb080e01432b87e6 | [
"CC0-1.0"
] | null | null | null | """Here we import the different task submodules/ collections"""
from invoke import Collection, task
from tasks import docker, package, sphinx, test # pylint: disable=import-self
# pylint: disable=invalid-name
# as invoke only recognizes lower case
namespace = Collection()
namespace.add_collection(test)
namespace.add... | 31.307692 | 78 | 0.808354 | from invoke import Collection, task
from tasks import docker, package, sphinx, test
namespace = Collection()
namespace.add_collection(test)
namespace.add_collection(docker)
namespace.add_collection(package)
namespace.add_collection(sphinx)
| true | true |
f70cddc3e741ebf77bb585329e60eada73e20d13 | 1,768 | py | Python | albow/openGL/GLOrtho.py | hasii2011/albow-python-3 | 04b9d42705b370b62f0e49d10274eebf3ac54bc1 | [
"MIT"
] | 6 | 2019-04-30T23:50:39.000Z | 2019-11-04T06:15:02.000Z | albow/openGL/GLOrtho.py | hasii2011/albow-python-3 | 04b9d42705b370b62f0e49d10274eebf3ac54bc1 | [
"MIT"
] | 73 | 2019-05-12T18:43:14.000Z | 2021-04-13T19:19:03.000Z | albow/openGL/GLOrtho.py | hasii2011/albow-python-3 | 04b9d42705b370b62f0e49d10274eebf3ac54bc1 | [
"MIT"
] | null | null | null |
from pygame import Rect
# noinspection PyPackageRequirements
from OpenGL import GL
from albow.openGL.GLViewport import GLViewport
class GLOrtho(GLViewport):
"""
GLOrtho provides an OpenGL drawing area with an orthographic projection.
Using a GLOrtho widget is the same as using a GLViewport, except tha... | 29.466667 | 98 | 0.625566 |
from pygame import Rect
from OpenGL import GL
from albow.openGL.GLViewport import GLViewport
class GLOrtho(GLViewport):
def __init__(self, rect: Rect=None, xmin=-1, xmax=1, ymin=-1, ymax=1, near=-1, far=1, **kwds):
super().__init__(rect, **kwds)
self.xmin = xmin... | true | true |
f70cdf1b212aa1b3168e274d8de517262a3bdb7d | 7,227 | py | Python | pontoon/tags/tests/utils/test_tags.py | nanopony/pontoon | ebd342922d04df2dfbbce23ac5a15ee1e71d50fe | [
"BSD-3-Clause"
] | 1 | 2018-12-24T11:15:35.000Z | 2018-12-24T11:15:35.000Z | pontoon/tags/tests/utils/test_tags.py | nanopony/pontoon | ebd342922d04df2dfbbce23ac5a15ee1e71d50fe | [
"BSD-3-Clause"
] | 1 | 2018-08-03T12:02:41.000Z | 2018-08-03T12:02:41.000Z | pontoon/tags/tests/utils/test_tags.py | nanopony/pontoon | ebd342922d04df2dfbbce23ac5a15ee1e71d50fe | [
"BSD-3-Clause"
] | 1 | 2019-07-17T21:21:41.000Z | 2019-07-17T21:21:41.000Z |
import pytest
from mock import MagicMock, patch, PropertyMock
from pontoon.tags.models import Tag
from pontoon.tags.utils import (
TagsLatestTranslationsTool, TagsResourcesTool,
TagsStatsTool, TagsTool, TagTool)
from pontoon.tags.utils.base import Clonable
def test_util_tags_tool():
# test tags tool in... | 32.12 | 74 | 0.682164 |
import pytest
from mock import MagicMock, patch, PropertyMock
from pontoon.tags.models import Tag
from pontoon.tags.utils import (
TagsLatestTranslationsTool, TagsResourcesTool,
TagsStatsTool, TagsTool, TagTool)
from pontoon.tags.utils.base import Clonable
def test_util_tags_tool():
tags_tool = Tag... | true | true |
f70ce1179beb4fa649da647a7ffe263a21a75625 | 1,025 | py | Python | backend/votes/migrations/0001_initial.py | mnieber/lindyscience | 468160aa6da42f45d8c37a2141a077a48410f81d | [
"MIT"
] | null | null | null | backend/votes/migrations/0001_initial.py | mnieber/lindyscience | 468160aa6da42f45d8c37a2141a077a48410f81d | [
"MIT"
] | 21 | 2020-02-11T23:50:05.000Z | 2022-02-27T17:44:29.000Z | backend/votes/migrations/0001_initial.py | mnieber/lindyscience | 468160aa6da42f45d8c37a2141a077a48410f81d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-26 16:31
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 34.166667 | 128 | 0.633171 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0002_remove_content_type... | true | true |
f70ce14c3ec536405be5c819c12da8f86f9c0e0c | 6,967 | py | Python | gupb/view/render.py | janusz-tracz/czesc_gupb | ea33376769657e1a8b97b02a2abd93679b32ae88 | [
"MIT"
] | null | null | null | gupb/view/render.py | janusz-tracz/czesc_gupb | ea33376769657e1a8b97b02a2abd93679b32ae88 | [
"MIT"
] | null | null | null | gupb/view/render.py | janusz-tracz/czesc_gupb | ea33376769657e1a8b97b02a2abd93679b32ae88 | [
"MIT"
] | null | null | null | from __future__ import annotations
import os
import itertools
from typing import Any, Optional, TypeVar
import pygame
from gupb.controller import keyboard
from gupb.model import characters
from gupb.model import effects
from gupb.model import games
from gupb.model import tiles
from gupb.model import weapons
pygame.i... | 41.224852 | 109 | 0.615186 | from __future__ import annotations
import os
import itertools
from typing import Any, Optional, TypeVar
import pygame
from gupb.controller import keyboard
from gupb.model import characters
from gupb.model import effects
from gupb.model import games
from gupb.model import tiles
from gupb.model import weapons
pygame.i... | true | true |
f70ce1740834426274a39514b249231aca415f40 | 2,195 | py | Python | packages/pyre/patterns/AttributeClassifier.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | 3 | 2019-08-02T21:02:47.000Z | 2021-09-08T13:59:43.000Z | packages/pyre/patterns/AttributeClassifier.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/patterns/AttributeClassifier.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# externals
import collections
# superclass
from .AbstractMetaclass import AbstractMetaclass
# class declaration
class AttributeClassifier(AbstractMetaclass):
"""
A base metaclass that enables attribute categ... | 32.761194 | 95 | 0.701139 |
import collections
from .AbstractMetaclass import AbstractMetaclass
class AttributeClassifier(AbstractMetaclass):
pyre_reserved = set()
@classmethod
def __prepare__(cls, name, bases, **kwds):
return collections.OrderedDict()
@classmethod
def pyre_harvest(cls, at... | true | true |
f70ce20b183d9c357e08cab8205ce597f7cc90c0 | 618 | py | Python | mapper.py | Cerebex/simple_Hadoop_MapReduce_example | 15abe31942db3f7f5884248f81d867fa736f9d6c | [
"MIT"
] | null | null | null | mapper.py | Cerebex/simple_Hadoop_MapReduce_example | 15abe31942db3f7f5884248f81d867fa736f9d6c | [
"MIT"
] | null | null | null | mapper.py | Cerebex/simple_Hadoop_MapReduce_example | 15abe31942db3f7f5884248f81d867fa736f9d6c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import string
from sklearn.feature_extraction import text
stops = set(text.ENGLISH_STOP_WORDS)
# get all lines from stdin
for line in sys.stdin:
# remove leading and trailing whitespace, lower case letters, remove punctuation
line = line.strip().lower().translate(None, string.p... | 36.352941 | 85 | 0.697411 | import sys
import string
from sklearn.feature_extraction import text
stops = set(text.ENGLISH_STOP_WORDS)
for line in sys.stdin:
line = line.strip().lower().translate(None, string.punctuation)
words = line.split()
for word in words:
if word not in stops:
print '%s\t%s... | false | true |
f70ce260fbedc20ce6468e1c73bcde5215e6e54c | 4,697 | py | Python | marlgrid/envs/__init__.py | s-mawjee/marlgrid | a2bb039fde2a789715bfe7ecb9f84d78cbecbc24 | [
"Apache-2.0"
] | null | null | null | marlgrid/envs/__init__.py | s-mawjee/marlgrid | a2bb039fde2a789715bfe7ecb9f84d78cbecbc24 | [
"Apache-2.0"
] | null | null | null | marlgrid/envs/__init__.py | s-mawjee/marlgrid | a2bb039fde2a789715bfe7ecb9f84d78cbecbc24 | [
"Apache-2.0"
] | null | null | null | from ..base import MultiGridEnv
from .empty import EmptyMultiGrid, EmptyColorMultiGrid
from .doorkey import DoorKeyEnv
from .cluttered import ClutteredMultiGrid
from .goalcycle import ClutteredGoalCycleEnv
from .viz_test import VisibilityTestEnv
from .hallways import HallWaysMultiGrid
from .comm_game import Communicat... | 25.252688 | 87 | 0.631254 | from ..base import MultiGridEnv
from .empty import EmptyMultiGrid, EmptyColorMultiGrid
from .doorkey import DoorKeyEnv
from .cluttered import ClutteredMultiGrid
from .goalcycle import ClutteredGoalCycleEnv
from .viz_test import VisibilityTestEnv
from .hallways import HallWaysMultiGrid
from .comm_game import Communicat... | true | true |
f70ce322dbdb58b9a889faa2dc81d50d6ec92438 | 18,167 | py | Python | tests/framework/test_events.py | svidoso/ipopo | 1d4b81207e67890dfccc8f562336c7104f194c17 | [
"Apache-2.0"
] | 65 | 2015-04-21T10:41:18.000Z | 2022-01-02T16:25:40.000Z | tests/framework/test_events.py | svidoso/ipopo | 1d4b81207e67890dfccc8f562336c7104f194c17 | [
"Apache-2.0"
] | 85 | 2015-01-20T14:23:52.000Z | 2022-02-19T17:08:46.000Z | tests/framework/test_events.py | svidoso/ipopo | 1d4b81207e67890dfccc8f562336c7104f194c17 | [
"Apache-2.0"
] | 32 | 2015-03-13T07:43:05.000Z | 2020-04-24T07:56:53.000Z | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Tests the framework events.
:author: Thomas Calmant
"""
# Standard library
try:
import unittest2 as unittest
except ImportError:
import unittest
# Pelix
from pelix.framework import FrameworkFactory, Bundle, BundleException, \
BundleContext, Bundle... | 32.733333 | 80 | 0.59476 |
try:
import unittest2 as unittest
except ImportError:
import unittest
from pelix.framework import FrameworkFactory, Bundle, BundleException, \
BundleContext, BundleEvent, ServiceEvent
from pelix.services import SERVICE_EVENT_LISTENER_HOOK
from tests import log_on, log_off
from tests.interfaces import IEc... | true | true |
f70ce34117ba3df7c222bb20549fc1467f2d3a87 | 8,468 | py | Python | tests/test_core.py | kevinheavey/borsh-py | e49dee71716ec217e8c9966aaa621c61669f7c15 | [
"MIT"
] | 11 | 2021-10-04T19:47:22.000Z | 2022-03-27T05:27:17.000Z | tests/test_core.py | kevinheavey/borsh-py | e49dee71716ec217e8c9966aaa621c61669f7c15 | [
"MIT"
] | 8 | 2021-09-30T13:57:43.000Z | 2022-03-14T11:20:53.000Z | tests/test_core.py | kevinheavey/borsh-py | e49dee71716ec217e8c9966aaa621c61669f7c15 | [
"MIT"
] | 4 | 2021-11-13T10:46:37.000Z | 2022-03-27T05:27:20.000Z | """Core tests."""
from typing import Any
import pytest
from borsh_construct import (
F32,
F64,
I8,
I16,
I32,
I64,
I128,
U8,
U16,
U32,
U64,
U128,
Bool,
Vec,
CStruct,
TupleStruct,
Enum,
String,
Option,
HashMap,
HashSet,
Bytes,
)
from... | 21.881137 | 86 | 0.41769 | from typing import Any
import pytest
from borsh_construct import (
F32,
F64,
I8,
I16,
I32,
I64,
I128,
U8,
U16,
U32,
U64,
U128,
Bool,
Vec,
CStruct,
TupleStruct,
Enum,
String,
Option,
HashMap,
HashSet,
Bytes,
)
from borsh_construct.c... | true | true |
f70ce39d0ffbfb8b9b2bf0200c9ad87b5f53c49d | 5,021 | py | Python | sample/pid/wall_follower_pid.py | savazeb/cosmos-ai | 4606e959396ebedca73086601078aa9c0ed77b31 | [
"MIT"
] | null | null | null | sample/pid/wall_follower_pid.py | savazeb/cosmos-ai | 4606e959396ebedca73086601078aa9c0ed77b31 | [
"MIT"
] | null | null | null | sample/pid/wall_follower_pid.py | savazeb/cosmos-ai | 4606e959396ebedca73086601078aa9c0ed77b31 | [
"MIT"
] | null | null | null | import sys
sys.path.append("../..")
from api.control.PID import PID
from api.control.sensor import sensor
from api.control.robot import robot
import posix_ipc as ipc
import time
import threading
import math
import numpy as np
graphq = ipc.MessageQueue('/graphQueue', ipc.O_CREAT)
mq = ipc.MessageQueue('/keyQueue', ipc... | 31.186335 | 117 | 0.520016 | import sys
sys.path.append("../..")
from api.control.PID import PID
from api.control.sensor import sensor
from api.control.robot import robot
import posix_ipc as ipc
import time
import threading
import math
import numpy as np
graphq = ipc.MessageQueue('/graphQueue', ipc.O_CREAT)
mq = ipc.MessageQueue('/keyQueue', ipc... | true | true |
f70ce4a07512185fe6b340ce3de6595da8c779d4 | 5,801 | py | Python | dynsimf/examples/school_segregation.py | Tensaiz/DyNSimF | 6288ff83f1b3f56fa626f741b55ade57b7c1b358 | [
"BSD-2-Clause"
] | 3 | 2020-11-04T08:52:33.000Z | 2021-01-27T22:27:07.000Z | dynsimf/examples/school_segregation.py | Tensaiz/DyNSimF | 6288ff83f1b3f56fa626f741b55ade57b7c1b358 | [
"BSD-2-Clause"
] | 2 | 2020-11-13T07:49:33.000Z | 2020-11-16T08:22:13.000Z | dynsimf/examples/school_segregation.py | Tensaiz/DyNSimF | 6288ff83f1b3f56fa626f741b55ade57b7c1b358 | [
"BSD-2-Clause"
] | null | null | null | import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
import pickle
import math
from dynsimf.models.Model import Model
from dynsimf.models.Model import ModelConfiguration
from dynsimf.models.components.Memory import MemoryConfiguration
from dynsimf.models.components.Memory import MemoryConfiguration... | 31.188172 | 134 | 0.58421 | import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
import pickle
import math
from dynsimf.models.Model import Model
from dynsimf.models.Model import ModelConfiguration
from dynsimf.models.components.Memory import MemoryConfiguration
from dynsimf.models.components.Memory import MemoryConfiguration... | true | true |
f70ce603d9a803770d32c0f20b1a94a6eaaa3c20 | 23,141 | py | Python | pyais/decode.py | KingKongOne/pyais | ddee5cc4eb8f01f494c82f7b14bdd55aa393af47 | [
"MIT"
] | 1 | 2021-02-24T07:13:46.000Z | 2021-02-24T07:13:46.000Z | pyais/decode.py | KingKongOne/pyais | ddee5cc4eb8f01f494c82f7b14bdd55aa393af47 | [
"MIT"
] | null | null | null | pyais/decode.py | KingKongOne/pyais | ddee5cc4eb8f01f494c82f7b14bdd55aa393af47 | [
"MIT"
] | null | null | null | from functools import partial
from pyais.exceptions import UnknownMessageException
import typing
import bitarray
from pyais.constants import (
NavigationStatus,
ManeuverIndicator,
TransmitMode,
EpfdType,
ShipType,
StationType,
StationIntervals,
NavAid
)
from pyais.util import get_int, ... | 33.296403 | 110 | 0.630267 | from functools import partial
from pyais.exceptions import UnknownMessageException
import typing
import bitarray
from pyais.constants import (
NavigationStatus,
ManeuverIndicator,
TransmitMode,
EpfdType,
ShipType,
StationType,
StationIntervals,
NavAid
)
from pyais.util import get_int, ... | true | true |
f70ce61faa9d386dd5eb06bbf87f5f0b8e80d8b7 | 12,161 | py | Python | pylabnet/hardware/polarization/thorlabs_mpc320.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | 10 | 2020-01-07T23:28:49.000Z | 2022-02-02T19:09:17.000Z | pylabnet/hardware/polarization/thorlabs_mpc320.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | 249 | 2019-12-28T19:38:49.000Z | 2022-03-28T16:45:32.000Z | pylabnet/hardware/polarization/thorlabs_mpc320.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | 5 | 2020-11-17T19:45:10.000Z | 2022-01-04T18:07:04.000Z | """ Module for controlling Thorlabs motorized pollarization paddles """
import ctypes
from ctypes import Structure
import time
from pylabnet.utils.logging.logger import LogHandler
#from comtypes.typeinfo import SAFEARRAYABOUND
#enum FT_Status
FT_OK = ctypes.c_short(0x00)
FT_InvalidHandle = ctypes.c_short(0x0)
FT_Dev... | 48.450199 | 214 | 0.709892 | import ctypes
from ctypes import Structure
import time
from pylabnet.utils.logging.logger import LogHandler
FT_OK = ctypes.c_short(0x00)
FT_InvalidHandle = ctypes.c_short(0x0)
FT_DeviceNotFound = ctypes.c_short(0x02)
FT_DeviceNotOpened = ctypes.c_short(0x03)
FT_IOError = ctypes.c_short(0x04)
FT_InsufficientResources... | true | true |
f70ce792696d4d4c744b5ebc894430f044a62707 | 1,434 | py | Python | model/Base.py | massquantity/DNN-implementation | bca336749a2076fa2873f57d9c2b6f98ebf18a0d | [
"MIT"
] | null | null | null | model/Base.py | massquantity/DNN-implementation | bca336749a2076fa2873f57d9c2b6f98ebf18a0d | [
"MIT"
] | null | null | null | model/Base.py | massquantity/DNN-implementation | bca336749a2076fa2873f57d9c2b6f98ebf18a0d | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
from ..utils.activations import *
class NetworkBase(metaclass=ABCMeta):
def __init__(self, sizes, activation, last_layer, **kwargs):
self.sizes = sizes
self.num_layers = len(sizes)
if activation.lower() == "sigmoid":
self.activation = Sigm... | 35.85 | 64 | 0.580195 | from abc import ABCMeta, abstractmethod
from ..utils.activations import *
class NetworkBase(metaclass=ABCMeta):
def __init__(self, sizes, activation, last_layer, **kwargs):
self.sizes = sizes
self.num_layers = len(sizes)
if activation.lower() == "sigmoid":
self.activation = Sigm... | true | true |
f70ce7d6076b8cfa52b2cf0ad6a09abcd1241b5c | 1,881 | py | Python | setup.py | AndreMiras/prawtools | 5c9ccea34c2dff84dcd3540efe852d6a1c10df89 | [
"BSD-2-Clause"
] | 92 | 2015-01-04T14:35:32.000Z | 2022-03-21T20:42:26.000Z | setup.py | TheManFromEarth1/prawtools | 5c9ccea34c2dff84dcd3540efe852d6a1c10df89 | [
"BSD-2-Clause"
] | 27 | 2015-01-29T01:32:15.000Z | 2021-01-23T07:22:18.000Z | setup.py | TheManFromEarth1/prawtools | 5c9ccea34c2dff84dcd3540efe852d6a1c10df89 | [
"BSD-2-Clause"
] | 26 | 2015-02-20T15:32:00.000Z | 2020-07-13T21:55:04.000Z | """prawtools setup.py."""
import re
from codecs import open
from os import path
from setuptools import setup
PACKAGE_NAME = "prawtools"
HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, "README.md"), encoding="utf-8") as fp:
README = fp.read()
with open(path.join(HERE, PACKAGE_NAME, "__init__... | 29.390625 | 80 | 0.601276 |
import re
from codecs import open
from os import path
from setuptools import setup
PACKAGE_NAME = "prawtools"
HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, "README.md"), encoding="utf-8") as fp:
README = fp.read()
with open(path.join(HERE, PACKAGE_NAME, "__init__.py"), encoding="utf-8") a... | true | true |
f70ce833ac88def087cedd6e79afd8aa8251779a | 27,515 | py | Python | fusionmodel.py | zhaoaite/CorrMNN | f88a70a199b462e9f3648da3ffdc5ee80a3e5f02 | [
"MIT"
] | 1 | 2022-02-04T05:28:03.000Z | 2022-02-04T05:28:03.000Z | fusionmodel.py | zhaoaite/CorrMNN | f88a70a199b462e9f3648da3ffdc5ee80a3e5f02 | [
"MIT"
] | null | null | null | fusionmodel.py | zhaoaite/CorrMNN | f88a70a199b462e9f3648da3ffdc5ee80a3e5f02 | [
"MIT"
] | 1 | 2022-03-07T10:16:24.000Z | 2022-03-07T10:16:24.000Z | #-*- coding: utf-8 -*-
"""
Created on Mon Dec 10 12:48:22 2018
@author: Aite Zhao
"""
from __future__ import print_function
#import random
import tensorflow as tf
#from tensorflow.python.ops import rnn, rnn_cell
import numpy as np
#import plot_confusion_matrix
import rnn_cell_GRU as rnn_cell
import rnn
from sklearn i... | 47.034188 | 140 | 0.638016 |
from __future__ import print_function
import tensorflow as tf
import numpy as np
import rnn_cell_GRU as rnn_cell
import rnn
from sklearn import preprocessing
from sklearn.cross_validation import train_test_split
from sklearn.neighbors import KNeighborsClassifier
import matplotlib.pyplot as plt
import os
from tensorflo... | true | true |
f70ce91d5070d4971495752d0b2971a0ed5fb7f8 | 13,671 | py | Python | workflow/workflow_inventory.py | kking423/digital_library | 643c396991bbc9664312826e849d3b9baae98c0d | [
"MIT"
] | null | null | null | workflow/workflow_inventory.py | kking423/digital_library | 643c396991bbc9664312826e849d3b9baae98c0d | [
"MIT"
] | 2 | 2022-01-11T18:41:24.000Z | 2022-01-11T19:33:09.000Z | workflow/workflow_inventory.py | kking423/digital_library | 643c396991bbc9664312826e849d3b9baae98c0d | [
"MIT"
] | null | null | null | import datetime
import shutil
import services.inventory
import workflow
import pandas as pd
import os
import file_system
import file_system.images as images
import json
from file_system.file_system_object import FileSystemObject
from services import inventory, library
from tabulate import tabulate
import cv2
TEMP_FOL... | 37.975 | 122 | 0.616049 | import datetime
import shutil
import services.inventory
import workflow
import pandas as pd
import os
import file_system
import file_system.images as images
import json
from file_system.file_system_object import FileSystemObject
from services import inventory, library
from tabulate import tabulate
import cv2
TEMP_FOL... | true | true |
f70ce96a8fb69cd9133101e1c0f2f4391bb082bd | 5,814 | py | Python | tests/extension/thread_/slice/test_thread_slice.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/slice/test_thread_slice.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/slice/test_thread_slice.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import thread_slice
expected_verilog = """
module test;
reg CLK;
reg RST;
wire [8-1:0] LED;
blinkled
uut
(
.CLK(CLK),
.RST(RST),
.LED(LED)
);
initial begin
$dumpfile("uut.vcd");
$dumpv... | 23.256 | 69 | 0.567595 | from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import thread_slice
expected_verilog = """
module test;
reg CLK;
reg RST;
wire [8-1:0] LED;
blinkled
uut
(
.CLK(CLK),
.RST(RST),
.LED(LED)
);
initial begin
$dumpfile("uut.vcd");
$dumpv... | true | true |
f70cea74026656f6ccdc5980312c1f59190dedd6 | 1,982 | py | Python | testing/test.py | toothlessLi/crnn_keras | 1179a82a732b83482c40176350062b3aca4fc0ab | [
"MIT"
] | null | null | null | testing/test.py | toothlessLi/crnn_keras | 1179a82a732b83482c40176350062b3aca4fc0ab | [
"MIT"
] | null | null | null | testing/test.py | toothlessLi/crnn_keras | 1179a82a732b83482c40176350062b3aca4fc0ab | [
"MIT"
] | null | null | null | import keras
import tensorflow as tf
import keras.backend.tensorflow_backend as K
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
# config.gpu_options.per_process_gpu_memory_fraction = 0.9
sess = tf.Session(config=config)
K.set_session(sess)
import os
import sys
sys.path.insert(0, '../')
from models.... | 26.426667 | 76 | 0.646317 | import keras
import tensorflow as tf
import keras.backend.tensorflow_backend as K
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
K.set_session(sess)
import os
import sys
sys.path.insert(0, '../')
from models.crnn import crnn
from data_utils.transform import reshape_t... | true | true |
f70cea9f656df7e8a9c16b72e46e29149a840809 | 1,146 | py | Python | runtests.py | weijia/normal_admin | a4c59acb863921e4d04a318ce4f566736de3fa73 | [
"BSD-3-Clause"
] | null | null | null | runtests.py | weijia/normal_admin | a4c59acb863921e4d04a318ce4f566736de3fa73 | [
"BSD-3-Clause"
] | null | null | null | runtests.py | weijia/normal_admin | a4c59acb863921e4d04a318ce4f566736de3fa73 | [
"BSD-3-Clause"
] | null | null | null | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="normal_admin.urls",
INSTALLED_APPS=[
... | 21.222222 | 85 | 0.579407 | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="normal_admin.urls",
INSTALLED_APPS=[
... | true | true |
f70ced047dc89b6488d0f571a8acbb9c8375edae | 374 | py | Python | tethys_services/backends/azuread.py | ezrajrice/tethys | 238271ebb09913f1f57b0d127fd5c81bb4780a0a | [
"BSD-2-Clause"
] | 79 | 2015-10-05T13:13:28.000Z | 2022-02-01T12:30:33.000Z | tethys_services/backends/azuread.py | ezrajrice/tethys | 238271ebb09913f1f57b0d127fd5c81bb4780a0a | [
"BSD-2-Clause"
] | 542 | 2015-08-12T22:11:32.000Z | 2022-03-29T22:18:08.000Z | tethys_services/backends/azuread.py | Aquaveo/tethys | 15f67c3fb9458d3af2733542be5ea6391f33b222 | [
"BSD-2-Clause"
] | 71 | 2016-01-16T01:03:41.000Z | 2022-03-31T17:55:54.000Z | from social_core.backends.azuread_tenant import AzureADTenantOAuth2
from social_core.backends.azuread_b2c import AzureADB2COAuth2
from tethys_services.backends.multi_tenant_mixin import MultiTenantMixin
class AzureADTenantOAuth2MultiTenant(MultiTenantMixin, AzureADTenantOAuth2):
pass
class AzureADB2COAuth2Mult... | 28.769231 | 76 | 0.874332 | from social_core.backends.azuread_tenant import AzureADTenantOAuth2
from social_core.backends.azuread_b2c import AzureADB2COAuth2
from tethys_services.backends.multi_tenant_mixin import MultiTenantMixin
class AzureADTenantOAuth2MultiTenant(MultiTenantMixin, AzureADTenantOAuth2):
pass
class AzureADB2COAuth2Mult... | true | true |
f70ced754629060bae3326b8f2bd1badb8bc5501 | 1,020 | py | Python | test/testissourcefile.py | julianmi/umdinst | 5135f4766e02092d786747b7b0f8d9ea98434da6 | [
"BSD-3-Clause"
] | null | null | null | test/testissourcefile.py | julianmi/umdinst | 5135f4766e02092d786747b7b0f8d9ea98434da6 | [
"BSD-3-Clause"
] | null | null | null | test/testissourcefile.py | julianmi/umdinst | 5135f4766e02092d786747b7b0f8d9ea98434da6 | [
"BSD-3-Clause"
] | 1 | 2015-08-06T14:11:58.000Z | 2015-08-06T14:11:58.000Z | import unittest
import sys
sys.path.append('bin')
from umdinst import wrap
class TestIsSourceFile(unittest.TestCase):
def testHasExtension(self):
self.failUnless(wrap.hasextension('foo.c'))
self.failIf(wrap.hasextension('bar'))
def testIsSourceFile(self):
self.failUnless(wrap... | 34 | 60 | 0.660784 | import unittest
import sys
sys.path.append('bin')
from umdinst import wrap
class TestIsSourceFile(unittest.TestCase):
def testHasExtension(self):
self.failUnless(wrap.hasextension('foo.c'))
self.failIf(wrap.hasextension('bar'))
def testIsSourceFile(self):
self.failUnless(wrap... | true | true |
f70ceef2ab6bae6ad4f8907c714dd8958d5d1c1e | 2,992 | py | Python | Code/OneAgent/survivalProb.py | Spstolar/net-ev-accum | f2bb7cfa887ab02413cb3f56039edf32c43fa5aa | [
"MIT"
] | 1 | 2017-08-01T23:29:29.000Z | 2017-08-01T23:29:29.000Z | Code/OneAgent/survivalProb.py | Spstolar/net-ev-accum | f2bb7cfa887ab02413cb3f56039edf32c43fa5aa | [
"MIT"
] | 2 | 2017-08-03T19:20:18.000Z | 2017-10-18T23:00:59.000Z | Code/OneAgent/survivalProb.py | Spstolar/net-ev-accum | f2bb7cfa887ab02413cb3f56039edf32c43fa5aa | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
"""
As in evAccum.py, the direct simulation for a single agent. Here the code is modified to stop when the agent hits a
boundary and also tracks where the LLR paths are. This allows us to output an array of exit times and compute the
survival probability.
"""
# Parame... | 30.530612 | 119 | 0.669118 | import numpy as np
import matplotlib.pyplot as plt
"""
As in evAccum.py, the direct simulation for a single agent. Here the code is modified to stop when the agent hits a
boundary and also tracks where the LLR paths are. This allows us to output an array of exit times and compute the
survival probability.
"""
length =... | false | true |
f70cef0cc331211649b18f1eae1461fc2818761b | 63,619 | py | Python | pyglet/window/xlib/__init__.py | anukaal/pyglet | fce6287ecfacb5e8ac5bb6b960afa17fe5051c5b | [
"BSD-3-Clause"
] | null | null | null | pyglet/window/xlib/__init__.py | anukaal/pyglet | fce6287ecfacb5e8ac5bb6b960afa17fe5051c5b | [
"BSD-3-Clause"
] | null | null | null | pyglet/window/xlib/__init__.py | anukaal/pyglet | fce6287ecfacb5e8ac5bb6b960afa17fe5051c5b | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | 41.097545 | 131 | 0.582923 |
import unicodedata
import urllib.parse
from ctypes import *
from functools import lru_cache
import pyglet
from pyglet.window import WindowException, MouseCursorException
from pyglet.window import MouseCursor, DefaultMouseCursor, ImageMouseCursor
from pyglet.window import BaseWindow, _PlatformEventHandler, _ViewEventH... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.