hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
797c118bb089483f3b9e6c237d532eb4330578c6 | 4,579 | py | Python | climateeconomics/sos_processes/iam/witness_wo_energy/process.py | os-climate/witness-core | 3ef9a44d86804c5ad57deec3c9916348cb3bfbb8 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2022-01-14T06:37:42.000Z | 2022-01-14T06:37:42.000Z | climateeconomics/sos_processes/iam/witness_wo_energy/process.py | os-climate/witness-core | 3ef9a44d86804c5ad57deec3c9916348cb3bfbb8 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | climateeconomics/sos_processes/iam/witness_wo_energy/process.py | os-climate/witness-core | 3ef9a44d86804c5ad57deec3c9916348cb3bfbb8 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | '''
Copyright 2022 Airbus SAS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | 48.2 | 189 | 0.698624 |
797c12139656df369e2ee0f2df0330ceac9147e9 | 5,431 | py | Python | Lib/site-packages/pandas/tests/io/parser/compression.py | mukul-ch/apitest | 10e48c823c836346ae209bde332bdb7844d4c842 | [
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | pandas/tests/io/parser/compression.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | pandas/tests/io/parser/compression.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 2 | 2020-12-06T22:39:08.000Z | 2021-12-25T01:10:16.000Z | # -*- coding: utf-8 -*-
"""
Tests compressed data parsing functionality for all
of the parsers defined in parsers.py
"""
import pytest
import pandas.util.testing as tm
class CompressionTests(object):
def test_zip(self):
import zipfile
with open(self.csv1, 'rb') as data_file:
data ... | 33.115854 | 74 | 0.553489 |
797c123e9e7dac38192fe0abe44ebd64974e145e | 4,963 | py | Python | programmers/weely_challenge/escape_maze_1.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | programmers/weely_challenge/escape_maze_1.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | programmers/weely_challenge/escape_maze_1.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # [์นด์นด์ค] ๋ฏธ๋ก ํ์ถ
"""
๋ฏธ๋ก์ ๋
ธ๋๋ฅผ ํ์ํ๋๋ฐ ์์ด ์ด 4๊ฐ์ง ๊ฒฝ์ฐ๊ฐ ์กด์ฌ
1) cur ๊ฐ ํจ์ ์ด ์๋๊ณ , next ๊ฐ ํจ์ ์ด ์๋๋ค.
- ์ด ๊ฒฝ์ฐ์๋ ํ์ฌ ๊ฐ์ ์ด ์ฌ๋ฐ๋ฅธ ๊ฐ์ ์ผ ๊ฒฝ์ฐ์๋ง ํ์์ด ๊ฐ๋ฅ
- cur, next ๋ชจ๋ ํจ์ ์ด ์๋๊ธฐ ๋๋ฌธ์ ๋ ๊ฐ๋ฅผ ์ฐ๊ฒฐํ๊ณ ์๋ ๊ฐ์ ์ ๋ฐฉํฅ์ด ๋ฐ๋ ๊ฐ๋ฅ์ฑ์ ์๋ค.
2) cur ๊ฐ ํจ์ ์ด ์๋๊ณ , next ๋ง ํจ์
- ์ฌ๋ฐ๋ฅด์ง ์์ ๊ฐ์ ํํ๋ก ๋ฐ๋์ด์ ธ ์๋ ์ํ๋ฅผ ํ์ฑํ ๋์ด์๋ ์ํ๋ก ํํํ ๋,
- ์์ง ํจ์ node๋ฅผ ํ๋ฒ๋ ๋ฐฉ๋ฌธํ์ง ์์๊ฑฐ๋,
- ํจ์ ์นธ์ ์ง์๋ฒ ๋ฐฉ๋ฌธํจ์ผ๋ก์จ node๊ฐ ์ฐ๊ฒฐ๋์ด ์๋ ๋ชจ๋ ... | 32.019355 | 77 | 0.57022 |
797c1243ac6698b45e93676cc7078336084354ea | 4,661 | py | Python | tests/test_aspects.py | thetestgame/wecs | 16ac277ec96d7689e7b5c9c245c0f81d57c955bb | [
"BSD-3-Clause"
] | 13 | 2019-06-18T22:05:53.000Z | 2021-11-29T21:43:23.000Z | tests/test_aspects.py | thetestgame/wecs | 16ac277ec96d7689e7b5c9c245c0f81d57c955bb | [
"BSD-3-Clause"
] | 21 | 2019-12-31T10:11:05.000Z | 2020-11-01T23:00:24.000Z | tests/test_aspects.py | thetestgame/wecs | 16ac277ec96d7689e7b5c9c245c0f81d57c955bb | [
"BSD-3-Clause"
] | 6 | 2019-09-30T20:49:40.000Z | 2020-11-10T01:31:55.000Z | import pytest
from wecs.core import Component
from wecs.aspects import Aspect
from wecs.aspects import factory
# from wecs.aspects import MetaAspect
from fixtures import world
@Component()
class Component_A:
i: int = 0
@Component()
class Component_B:
i: int = 0
@Component()
class Component_C:
pass
... | 24.025773 | 64 | 0.690839 |
797c1321282caaafa2c11a6c93c47a256ba4c73a | 1,656 | py | Python | src/graphql/pyutils/__init__.py | astronouth7303/graphql-core | fc5ad0bd527368f395471c685716643f6957caec | [
"MIT"
] | null | null | null | src/graphql/pyutils/__init__.py | astronouth7303/graphql-core | fc5ad0bd527368f395471c685716643f6957caec | [
"MIT"
] | null | null | null | src/graphql/pyutils/__init__.py | astronouth7303/graphql-core | fc5ad0bd527368f395471c685716643f6957caec | [
"MIT"
] | null | null | null | """Python Utils
This package contains dependency-free Python utility functions used throughout the
codebase.
Each utility should belong in its own file and be the default export.
These functions are not part of the module interface and are subject to change.
"""
from .convert_case import camel_to_snake, snake_to_ca... | 26.285714 | 82 | 0.763889 |
797c1386ca941e60588b00d050fdd67025b476c6 | 1,308 | py | Python | funcat/data/okex/exceptions.py | xuan-wang/funcat | c4b184942564ab8a4092acb4907ab069fc44683c | [
"Apache-2.0"
] | 18 | 2019-05-30T01:00:38.000Z | 2022-01-03T15:46:25.000Z | funcat/data/okex/exceptions.py | xuan-wang/funcat | c4b184942564ab8a4092acb4907ab069fc44683c | [
"Apache-2.0"
] | 5 | 2019-05-28T15:01:18.000Z | 2021-11-24T14:08:39.000Z | funcat/data/okex/exceptions.py | xuan-wang/funcat | c4b184942564ab8a4092acb4907ab069fc44683c | [
"Apache-2.0"
] | 8 | 2020-10-30T10:03:02.000Z | 2021-12-04T07:20:36.000Z | # coding=utf-8
class OkexAPIException(Exception):
def __init__(self, response):
print(response.text + ', ' + str(response.status_code))
self.code = 0
try:
json_res = response.json()
except ValueError:
self.message = 'Invalid JSON error message from... | 27.829787 | 92 | 0.577982 |
797c14b92aff186230d9007cdb23f8c5a571b65f | 2,301 | py | Python | Marriage bereau.py | OmkarGharat/Marriage-Bereau-registration-form- | 4adcd1261f6c3321483507f25753fcaa587283d3 | [
"MIT"
] | null | null | null | Marriage bereau.py | OmkarGharat/Marriage-Bereau-registration-form- | 4adcd1261f6c3321483507f25753fcaa587283d3 | [
"MIT"
] | null | null | null | Marriage bereau.py | OmkarGharat/Marriage-Bereau-registration-form- | 4adcd1261f6c3321483507f25753fcaa587283d3 | [
"MIT"
] | null | null | null | # marriage bereau registration form :
from tkinter import *
def details():
print(f"Full Name : {name.get()}")
print(f"Address : {address.get()}")
print(f"City : {City.get()}")
print(f"Gender : {Gender.get()}")
print(f"Date of birth : {dob.get()}")
print(f"Education : {education.get()... | 32.408451 | 86 | 0.586267 |
797c14c67e8a94bddf34a122191df59fa362226e | 171 | py | Python | ABC117/ABC117b.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC117/ABC117b.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC117/ABC117b.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | # ABC117b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
input()
l = list(map(int, input().split()))
print('Yes' if max(l) < sum(l)-max(l) else 'No')
| 19 | 48 | 0.666667 |
797c15ace0f7950a35e01dabae1c66e18e686cd3 | 46,042 | py | Python | tensorflow/contrib/quantize/python/quantize.py | Dimitri1/tensorflow | f6abc3f094b27385a5e0c18ac3edd646d022890b | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/quantize/python/quantize.py | Dimitri1/tensorflow | f6abc3f094b27385a5e0c18ac3edd646d022890b | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/quantize/python/quantize.py | Dimitri1/tensorflow | f6abc3f094b27385a5e0c18ac3edd646d022890b | [
"Apache-2.0"
] | 1 | 2020-09-09T11:26:56.000Z | 2020-09-09T11:26:56.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.018644 | 80 | 0.677077 |
797c15cb09cbdda76fb9f09a12fce822ab88448a | 7,957 | py | Python | server.py | lache/RacingKingLee | eb3a961c6c71d44e797eb2394613e4c8196feb31 | [
"MIT"
] | null | null | null | server.py | lache/RacingKingLee | eb3a961c6c71d44e797eb2394613e4c8196feb31 | [
"MIT"
] | null | null | null | server.py | lache/RacingKingLee | eb3a961c6c71d44e797eb2394613e4c8196feb31 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import tornado.ioloop
import tornado.web
import ujson as json
import uuid
import math
import thread
import sys
from arena import racingArena
from car import car
# start racing arena thread
racing_arena = racingArena()
def check_int(s):
if s[0] in ('-', '+'):
return s[1:].isdigi... | 28.017606 | 74 | 0.563278 |
797c166480e504efc68ff36596c53a0c2c0b357c | 1,298 | py | Python | solver.py | yehorb/udata-mathpro-1 | 4523140231fbbe1349ce801f8f2aa9babfd5c80a | [
"MIT"
] | null | null | null | solver.py | yehorb/udata-mathpro-1 | 4523140231fbbe1349ce801f8f2aa9babfd5c80a | [
"MIT"
] | null | null | null | solver.py | yehorb/udata-mathpro-1 | 4523140231fbbe1349ce801f8f2aa9babfd5c80a | [
"MIT"
] | null | null | null | import sys
import argparse
from core.input import get
from core import utils, gaussian, lu, functions
parser = argparse.ArgumentParser(description='Matrice solver 101.', epilog='Happy solving!')
parser.add_argument('input', nargs='?', default=sys.stdin, type=argparse.FileType('r'), help='specify where to get data')
p... | 43.266667 | 139 | 0.74037 |
797c17048df1bc3c6631175c091c55964a6537ca | 1,838 | py | Python | Icons.py | kinoute/hivacruz-sublime-theme | 349f352224a08e672a9a14407936c543d0148332 | [
"MIT"
] | 1 | 2021-06-15T19:02:11.000Z | 2021-06-15T19:02:11.000Z | Icons.py | kinoute/hivacruz-sublime-theme | 349f352224a08e672a9a14407936c543d0148332 | [
"MIT"
] | null | null | null | Icons.py | kinoute/hivacruz-sublime-theme | 349f352224a08e672a9a14407936c543d0148332 | [
"MIT"
] | null | null | null | """
A File Icon Installer
"""
import os
import sublime
ICONS_PACKAGE = "A File Icon"
PKGCTRL_SETTINGS = "Package Control.sublime-settings"
THEME_NAME = os.path.splitext(os.path.basename(os.path.dirname(__file__)))[0]
MSG = """\
<div id="afi-installer">
<style>
#afi-installer {{
padding: 1rem;
line... | 22.691358 | 79 | 0.627856 |
797c172f92068223207c8d34e74e0cc4ab3f06cf | 8,915 | py | Python | geonorm/geomatch.py | CAG-ru/geonorm | 891492927092ee1eb5d0a70623952076fdbeea52 | [
"Apache-2.0"
] | 2 | 2022-03-22T20:28:30.000Z | 2022-03-22T20:28:35.000Z | geonorm/geomatch.py | CAG-ru/geonorm | 891492927092ee1eb5d0a70623952076fdbeea52 | [
"Apache-2.0"
] | null | null | null | geonorm/geomatch.py | CAG-ru/geonorm | 891492927092ee1eb5d0a70623952076fdbeea52 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
import pathlib
import logging
from copy import copy
import numpy as np
class Geomatch:
def __init__(self,
standard_db=False,
# ะฟะพััะดะพะบ ะบะพะปะพะฝะพะบ ะธะผ... | 38.098291 | 129 | 0.57106 |
797c17de5af7f1e85a945a244a83d383d3122f9f | 1,124 | py | Python | PracticeExam/P2/array_remove.py | tordisuna/SC-T-201-GSKI | 1e89e5b31e7d74aeecae3dffe2df7ac9e8bb40f2 | [
"MIT"
] | null | null | null | PracticeExam/P2/array_remove.py | tordisuna/SC-T-201-GSKI | 1e89e5b31e7d74aeecae3dffe2df7ac9e8bb40f2 | [
"MIT"
] | null | null | null | PracticeExam/P2/array_remove.py | tordisuna/SC-T-201-GSKI | 1e89e5b31e7d74aeecae3dffe2df7ac9e8bb40f2 | [
"MIT"
] | 1 | 2021-02-12T11:36:53.000Z | 2021-02-12T11:36:53.000Z |
class ArrayList:
def __init__(self):
self.capacity = 4
self.arr = [None] * self.capacity
self.size = 0
def _resize(self):
self.capacity *= 2
tmp_arr = [None] * self.capacity
for i in range(self.size):
tmp_arr[i] = self.arr[i]
self.arr = tmp_a... | 21.207547 | 53 | 0.52758 |
797c18c849d51e1da2d9c91d28121c0e39e885ea | 1,370 | py | Python | cutecharts/components/page.py | chenjiandongx/cutecharts.py | 91f4b90824845b92280691f40555e990f2339aed | [
"MIT"
] | 368 | 2020-03-31T10:55:27.000Z | 2022-03-30T07:21:18.000Z | cutecharts/components/page.py | chenjiandongx/cutecharts.py | 91f4b90824845b92280691f40555e990f2339aed | [
"MIT"
] | 9 | 2019-10-12T12:53:32.000Z | 2020-03-28T07:22:05.000Z | cutecharts/components/page.py | chenjiandongx/cutecharts.py | 91f4b90824845b92280691f40555e990f2339aed | [
"MIT"
] | 46 | 2020-04-12T14:26:21.000Z | 2022-02-10T20:24:21.000Z | import json
import uuid
from typing import Optional
from cutecharts.globals import CurrentConfig
from cutecharts.render.engine import RenderEngine, remove_key_with_none_value
class Page(RenderEngine):
def __init__(self, assets_host: Optional[str] = None):
super().__init__()
self._chart... | 32.619048 | 89 | 0.634307 |
797c19e9ff20bdc6000cf18747c0d17280969db0 | 9,165 | py | Python | ktrain/text/ner/data.py | rubensmau/ktrain | de32b87b9d3996f35882e7ca18273356c72d342c | [
"Apache-2.0"
] | null | null | null | ktrain/text/ner/data.py | rubensmau/ktrain | de32b87b9d3996f35882e7ca18273356c72d342c | [
"Apache-2.0"
] | null | null | null | ktrain/text/ner/data.py | rubensmau/ktrain | de32b87b9d3996f35882e7ca18273356c72d342c | [
"Apache-2.0"
] | null | null | null |
from ...imports import *
from ... import utils as U
from .. import textutils as TU
from . import preprocessor as pp
from .preprocessor import NERPreprocessor
MAXLEN = 128
WORD_COL = pp.WORD_COL
TAG_COL = pp.TAG_COL
SENT_COL = pp.SENT_COL
def entities_from_gmb(train_filepath,
val_filepath=N... | 36.955645 | 120 | 0.568467 |
797c1ad843fa7308f449fbce83532cc208a84ae2 | 419 | py | Python | accounts/forms.py | yezz123/Django-Authentication | 3f207660950370aeaf8377f062d4767a0f48fa8c | [
"MIT"
] | 10 | 2021-08-30T08:37:12.000Z | 2021-11-12T01:33:06.000Z | accounts/forms.py | yezz123/Django-Authentication | 3f207660950370aeaf8377f062d4767a0f48fa8c | [
"MIT"
] | null | null | null | accounts/forms.py | yezz123/Django-Authentication | 3f207660950370aeaf8377f062d4767a0f48fa8c | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.forms import fields
from .models import CustomUser
class CustomUserCreationForm(UserCreationForm):
class Meta:
model = CustomUser
fields = ("username", "email")
class CustomUserChangeForm(... | 24.647059 | 70 | 0.725537 |
797c1c23b2a39275b2ef7689ae0fab6894665d19 | 11,753 | py | Python | lib/pysgpp/extensions/datadriven/uq/sampler/Sample.py | valentjn/thesis | 65a0eb7d5f7488aac93882959e81ac6b115a9ea8 | [
"CC0-1.0"
] | 4 | 2022-01-15T19:50:36.000Z | 2022-01-15T20:16:10.000Z | lib/pysgpp/extensions/datadriven/uq/sampler/Sample.py | valentjn/thesis | 65a0eb7d5f7488aac93882959e81ac6b115a9ea8 | [
"CC0-1.0"
] | null | null | null | lib/pysgpp/extensions/datadriven/uq/sampler/Sample.py | valentjn/thesis | 65a0eb7d5f7488aac93882959e81ac6b115a9ea8 | [
"CC0-1.0"
] | null | null | null | import numpy as np
import pysgpp.extensions.datadriven.uq.jsonLib as ju
from copy import copy
class SampleType:
"""
Describes the type of a sample:
An active sample is a sample that just contains uncertain
parameters for which no deterministic value has been specified.
This allows to increase the ... | 36.84326 | 92 | 0.59789 |
797c1c396d79b11b3268d75052ec8081e91e0f3c | 390 | py | Python | Checker_game_by_dz/modules/statics.py | nicetone/Python | 85fd9cc7e00f3bbeed5355ce392128ff22de459b | [
"MIT"
] | 28,321 | 2015-01-03T15:36:19.000Z | 2022-03-31T10:11:54.000Z | Checker_game_by_dz/modules/statics.py | nicetone/Python | 85fd9cc7e00f3bbeed5355ce392128ff22de459b | [
"MIT"
] | 544 | 2015-01-19T14:28:09.000Z | 2022-03-29T04:05:21.000Z | Checker_game_by_dz/modules/statics.py | nicetone/Python | 85fd9cc7e00f3bbeed5355ce392128ff22de459b | [
"MIT"
] | 13,366 | 2015-01-03T15:45:14.000Z | 2022-03-31T11:50:26.000Z | '''
Author : Dhruv B Kakadiya
'''
import pygame as pg
# size of board
width, height = 800, 800
rows , cols = 8, 8
sq_size = width // cols
# colours for board
yellow = (255, 255, 0)
white = (255, 255, 255)
green = (0, 255, 0)
gray = (128, 128, 128)
red = (255, 0, 0)
# colour for for next move
black = (0, 0, 0)
cro... | 15.6 | 71 | 0.617949 |
797c1cf2f69ae7944237d559d03787218dd579ba | 10,963 | py | Python | main.py | legion-rgb/Cipherware | ec4932863a1590c45defcfb44d3eefaa52726291 | [
"MIT"
] | 4 | 2020-12-11T12:10:22.000Z | 2020-12-31T08:39:20.000Z | main.py | legion-rgb/Cipherware | ec4932863a1590c45defcfb44d3eefaa52726291 | [
"MIT"
] | null | null | null | main.py | legion-rgb/Cipherware | ec4932863a1590c45defcfb44d3eefaa52726291 | [
"MIT"
] | 1 | 2020-12-12T13:02:56.000Z | 2020-12-12T13:02:56.000Z | from tkinter import *
from tkinter.ttk import *
from PIL import Image
from PIL import ImageTk
import encode
#import decode
#import decode1
import pyperclip
#creating a function for importing encode
def ciph_encoder():
encode_entry.delete(0, END)
te = text_entry.get()
ke1 = key1_entry.get()
if var1.g... | 32.823353 | 89 | 0.658396 |
797c1e6beba775540311e251c967eab81b565336 | 440 | py | Python | PythonCommonModule/module_random.py | wengyuanyu/PythonLearning | 34430c86bda27cccaf3620a0414c1e2ec0f7b19d | [
"MIT"
] | null | null | null | PythonCommonModule/module_random.py | wengyuanyu/PythonLearning | 34430c86bda27cccaf3620a0414c1e2ec0f7b19d | [
"MIT"
] | null | null | null | PythonCommonModule/module_random.py | wengyuanyu/PythonLearning | 34430c86bda27cccaf3620a0414c1e2ec0f7b19d | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import random
# ็ๆ้ๆบๅ้
print("random.random()๏ผ", random.random())
print("random.randint()๏ผ", random.randint(1, 5))
print("random.randrange()๏ผ", random.randrange(10, 20))
# ๆฐๅญๅๅคงๅๅญๆฏ้ๆบ็ปๆ็4ไฝๅญ็ฌฆไธฒ
checknode = ''
for i in range(4):
current = random.randrange(0, 4)
if current != i:
temp... | 23.157895 | 54 | 0.631818 |
797c1ea56fa23659192698b187fb6f95b4b40620 | 14,868 | py | Python | nikola/shortcodes.py | ivanyschen/nikola | c75adc76f008af7ac37b009f71764f5bf0c48e87 | [
"MIT"
] | 1,901 | 2015-01-02T02:49:51.000Z | 2022-03-30T23:31:35.000Z | nikola/shortcodes.py | ivanyschen/nikola | c75adc76f008af7ac37b009f71764f5bf0c48e87 | [
"MIT"
] | 1,755 | 2015-01-01T08:17:16.000Z | 2022-03-24T18:02:22.000Z | nikola/shortcodes.py | ivanyschen/nikola | c75adc76f008af7ac37b009f71764f5bf0c48e87 | [
"MIT"
] | 421 | 2015-01-02T18:06:37.000Z | 2022-03-28T23:18:54.000Z | # -*- coding: utf-8 -*-
# Copyright ยฉ 2012-2021 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights t... | 38.319588 | 181 | 0.581854 |
797c1f1729020ccb9a9725816d41f8654ecf1899 | 4,130 | py | Python | src/models/sg_sem_cont/__init__.py | lavoiems/SADt | 26cce9d0dbc58f1a57de617d9eb49efe55d9ac59 | [
"MIT"
] | 2 | 2021-06-28T14:21:28.000Z | 2021-12-24T12:52:56.000Z | src/models/sg_sem_cont/__init__.py | lavoiems/SADt | 26cce9d0dbc58f1a57de617d9eb49efe55d9ac59 | [
"MIT"
] | null | null | null | src/models/sg_sem_cont/__init__.py | lavoiems/SADt | 26cce9d0dbc58f1a57de617d9eb49efe55d9ac59 | [
"MIT"
] | null | null | null | """
Code adapted from the StarGAN v2 repository: https://github.com/clovaai/stargan-v2
"""
import os
from munch import Munch
from .train import Solver
from common.loaders import images
from . import model
def subdirs(dname):
return [d for d in os.listdir(dname)
if os.path.isdir(os.path.join(dname, d... | 54.342105 | 132 | 0.710654 |
797c1f3e66bba8d8b567e646a4181c7e9da6063c | 2,016 | py | Python | airflow/migrations/versions/939bb1e647c8_task_reschedule_fk_on_cascade_delete.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 1 | 2020-08-13T15:17:03.000Z | 2020-08-13T15:17:03.000Z | airflow/migrations/versions/939bb1e647c8_task_reschedule_fk_on_cascade_delete.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 37 | 2020-07-21T07:50:02.000Z | 2022-03-29T22:31:28.000Z | airflow/migrations/versions/939bb1e647c8_task_reschedule_fk_on_cascade_delete.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.516129 | 62 | 0.686012 |
797c213bd9e2437a1154fb20f32d467d7a81beea | 2,236 | py | Python | test/conftest.py | etcher-be/esst | ac41cd0c07af8ca8532997f533756c529c9609a4 | [
"MIT"
] | 4 | 2018-06-24T14:03:44.000Z | 2019-01-21T01:20:02.000Z | test/conftest.py | etcher-be/esst | ac41cd0c07af8ca8532997f533756c529c9609a4 | [
"MIT"
] | 106 | 2018-06-24T13:59:52.000Z | 2019-11-26T09:05:14.000Z | test/conftest.py | theendsofinvention/esst | ac41cd0c07af8ca8532997f533756c529c9609a4 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Pytest config file
"""
import os
import sys
from pathlib import Path
import pytest
# from esst import core
def pytest_configure(config):
"""
Runs at tests startup
Args:
config: pytest config args
"""
print('pytest args: ', config.args)
os.environ['DCS_PATH'] = 't... | 23.536842 | 73 | 0.66458 |
797c21f35127af5bc946cb84640c9555c5421465 | 15,622 | py | Python | web-gui.py | songrun/VectorSkinning | a19dff78215b51d824adcd39c7dcdf8dc78ec617 | [
"Apache-2.0"
] | 18 | 2015-04-29T20:54:15.000Z | 2021-12-13T17:48:05.000Z | web-gui.py | songrun/VectorSkinning | a19dff78215b51d824adcd39c7dcdf8dc78ec617 | [
"Apache-2.0"
] | null | null | null | web-gui.py | songrun/VectorSkinning | a19dff78215b51d824adcd39c7dcdf8dc78ec617 | [
"Apache-2.0"
] | 8 | 2017-04-23T17:52:13.000Z | 2022-03-14T11:01:56.000Z | #!/opt/local/bin/python
## For anything
from twisted.internet import reactor
## For WebSockets
try:
## New style autobahn
from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol, listenWS
except ImportError:
## Old style autobahn
from autobahn.websocket import WebSocketServerFactory... | 33.167728 | 139 | 0.676098 |
797c220741e5b3a87e1a2406a5e1533173a6105d | 41,876 | py | Python | tests.py | Ventilateur/python-json-patch | a6526489c4b741e1b603b5bb988ecc9aefd3e880 | [
"BSD-3-Clause"
] | null | null | null | tests.py | Ventilateur/python-json-patch | a6526489c4b741e1b603b5bb988ecc9aefd3e880 | [
"BSD-3-Clause"
] | null | null | null | tests.py | Ventilateur/python-json-patch | a6526489c4b741e1b603b5bb988ecc9aefd3e880 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import decimal
import doctest
import unittest
import jsonpatch
import jsonpointer
import sys
try:
from types import MappingProxyType
except ImportError:
# Python < 3.3
MappingProxyType = dict
class ApplyPat... | 39.063433 | 286 | 0.550172 |
797c2236a127948ca6c03575a55e9aa7f62eb2c5 | 1,843 | py | Python | google/bigtable/v2/bigtable-v2-py/setup.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/bigtable/v2/bigtable-v2-py/setup.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/bigtable/v2/bigtable-v2-py/setup.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.509091 | 74 | 0.66522 |
797c22ae18129c5816e101c5e304ea0a5142435b | 4,382 | py | Python | cowait/types/test_types.py | ProgHaj/cowait | e95c30faab8caf8b0413de4e1784529a3a06475d | [
"Apache-2.0"
] | 2 | 2021-08-11T08:51:42.000Z | 2021-08-11T08:55:19.000Z | cowait/types/test_types.py | ProgHaj/cowait | e95c30faab8caf8b0413de4e1784529a3a06475d | [
"Apache-2.0"
] | null | null | null | cowait/types/test_types.py | ProgHaj/cowait | e95c30faab8caf8b0413de4e1784529a3a06475d | [
"Apache-2.0"
] | null | null | null | import pytest
from .mapping import is_cowait_type, convert_type, get_type
from .simple import Any, String, Int, Float, Bool
from .dict import Dict
from .list import List
class TestType(Any):
""" A custom input type """
pass
class NotType(object):
""" Another object that is not a valid type """
pass
... | 23.185185 | 62 | 0.618895 |
797c2374df4a52a40331ce4ddbc579092fb26a05 | 1,095 | py | Python | test/shell/test_nested_params.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 2,648 | 2019-06-03T17:18:27.000Z | 2022-03-31T08:29:22.000Z | test/shell/test_nested_params.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 1,220 | 2019-06-04T09:00:14.000Z | 2022-03-31T10:45:43.000Z | test/shell/test_nested_params.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 595 | 2019-06-04T01:04:31.000Z | 2022-03-30T10:40:26.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 32.205882 | 75 | 0.675799 |
797c238cbc120a2e07afb6e7adb227f7232027f0 | 15,872 | py | Python | src/genie/libs/parser/iosxe/traceroute.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 2 | 2021-01-27T03:37:39.000Z | 2021-01-27T03:40:50.000Z | src/genie/libs/parser/iosxe/traceroute.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 1 | 2020-08-01T00:23:31.000Z | 2020-08-01T00:40:05.000Z | src/genie/libs/parser/iosxe/traceroute.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | null | null | null | ''' traceroute.py
IOSXE parsers for the following show commands:
* traceroute {traceroute} numeric timeout {timeout} probe {probe} ttl {min} {max} source {source}
'''
# Python
import re
# Metaparser
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, Any, Or, Optional... | 42.100796 | 107 | 0.419229 |
797c24d10a02d5a06337670d4ab58e0606212ba2 | 1,672 | py | Python | aliyun-python-sdk-voicenavigator/aliyunsdkvoicenavigator/request/v20180612/DescribeTTSConfigRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-voicenavigator/aliyunsdkvoicenavigator/request/v20180612/DescribeTTSConfigRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-voicenavigator/aliyunsdkvoicenavigator/request/v20180612/DescribeTTSConfigRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38 | 92 | 0.77512 |
797c2583c654522efbe221fa2c72dc3728a198a4 | 148 | py | Python | src/Classes/MSDS400/PFinal/Q_10.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/PFinal/Q_10.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/PFinal/Q_10.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | from sympy import ( symbols, diff, pprint, simplify )
x = symbols( 'x' )
F = ( x**3 - 8 ) ** (2/3)
pprint( F )
pprint( simplify( diff( F, x ) ) ) | 18.5 | 53 | 0.554054 |
797c25901515259250b28fe262a9267aff43d9d2 | 335 | py | Python | guild/info_cmd.py | guildai/_guild-python-legacy | e552eff820d8edcfeb10b26bd5c8651548507b4a | [
"Apache-2.0"
] | null | null | null | guild/info_cmd.py | guildai/_guild-python-legacy | e552eff820d8edcfeb10b26bd5c8651548507b4a | [
"Apache-2.0"
] | null | null | null | guild/info_cmd.py | guildai/_guild-python-legacy | e552eff820d8edcfeb10b26bd5c8651548507b4a | [
"Apache-2.0"
] | null | null | null | import guild.source_cmd_support
def main(args):
pkg = guild.source_cmd_support.resolve_one_package(args.package)
_print_pkg_info(pkg)
def _print_pkg_info(pkg):
print("Package: %s" % pkg.key)
print("Version: %s" % pkg.version)
print("Description: %s" % pkg.description)
print("Tags: %s" % ", ".j... | 27.916667 | 68 | 0.683582 |
797c25d34bce994e78963f0a6961d4544477a2cd | 1,924 | py | Python | tests/test_spatial_cropd.py | KohYoungResearchAmerica/MONAI | eca3f19182b9fcee0be7123728a9826cd382d152 | [
"Apache-2.0"
] | 3 | 2020-07-02T18:39:36.000Z | 2021-06-16T09:35:53.000Z | tests/test_spatial_cropd.py | KohYoungResearchAmerica/MONAI | eca3f19182b9fcee0be7123728a9826cd382d152 | [
"Apache-2.0"
] | 28 | 2020-06-26T12:47:52.000Z | 2020-09-08T00:33:42.000Z | tests/test_spatial_cropd.py | KohYoungResearchAmerica/MONAI | eca3f19182b9fcee0be7123728a9826cd382d152 | [
"Apache-2.0"
] | 1 | 2021-01-19T19:35:00.000Z | 2021-01-19T19:35:00.000Z | # Copyright 2020 - 2021 MONAI Consortium
# 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... | 33.754386 | 101 | 0.58264 |
797c2791b9ca0eebfaadb732cd140f70e830a505 | 8,489 | py | Python | qa/rpc-tests/proxy_test.py | PapicoinProject/Papicoin | c971fcd1f81d07fe9de2e2c3893f362d9a8529f5 | [
"MIT"
] | 1 | 2022-03-19T16:50:57.000Z | 2022-03-19T16:50:57.000Z | qa/rpc-tests/proxy_test.py | PapicoinProject/Papicoin | c971fcd1f81d07fe9de2e2c3893f362d9a8529f5 | [
"MIT"
] | null | null | null | qa/rpc-tests/proxy_test.py | PapicoinProject/Papicoin | c971fcd1f81d07fe9de2e2c3893f362d9a8529f5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2022 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
import os
from test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Serv... | 41.612745 | 146 | 0.623277 |
797c287c7f2faaa2fdcc8cc726dc3140f62edf25 | 1,606 | py | Python | kha/settings.py | claui/kommtheuteaktenzeichen | 2afbdfd1731a8dd6e222d094b0ee26c1a1945e61 | [
"Apache-2.0"
] | 2 | 2021-06-06T15:29:08.000Z | 2021-06-07T20:37:38.000Z | kha/settings.py | claui/kommtheuteaktenzeichen | 2afbdfd1731a8dd6e222d094b0ee26c1a1945e61 | [
"Apache-2.0"
] | null | null | null | kha/settings.py | claui/kommtheuteaktenzeichen | 2afbdfd1731a8dd6e222d094b0ee26c1a1945e61 | [
"Apache-2.0"
] | 1 | 2021-05-31T16:48:08.000Z | 2021-05-31T16:48:08.000Z | """Shared paths and settings"""
from pathlib import Path
import dateutil.tz
PROJECT_ROOT = Path(__file__).parent.parent.absolute()
PACKAGE_ROOT = Path(__file__).parent.absolute()
SITE_NAME = 'Kommt heute Aktenzeichen?'
TV_SERIES_LONG_NAME = 'Aktenzeichen XY โฆ ungelรถst'
TV_NETWORK = 'ZDF'
EVENTS_JSON_BUCKET_DEV = '... | 18.674419 | 65 | 0.551681 |
797c28ebac89bcd92921804983859cac6bce0fbd | 538 | py | Python | app/core/urls.py | loop-assembly/backend-api | 0fc25a1e0236e874d11f0527001716fb936050e8 | [
"MIT"
] | 3 | 2022-01-22T13:59:13.000Z | 2022-01-24T08:30:36.000Z | app/core/urls.py | loop-assembly/backend-api | 0fc25a1e0236e874d11f0527001716fb936050e8 | [
"MIT"
] | null | null | null | app/core/urls.py | loop-assembly/backend-api | 0fc25a1e0236e874d11f0527001716fb936050e8 | [
"MIT"
] | 2 | 2022-01-01T17:09:01.000Z | 2022-01-01T17:47:25.000Z | from django.urls import path,include
from django.views.generic import base
from rest_framework.routers import DefaultRouter
from core import views
router = DefaultRouter()
router.register('hello-viewset' ,views.HelloViewSet,basename='hello-viewset')
router.register('profile', views.UserProfileViewset )
router.register... | 33.625 | 77 | 0.765799 |
797c2958393cdd7ccdf86bc1cb5577badbc0b399 | 34 | py | Python | tap_meltano/tests/__init__.py | Matatika/tap-meltano | 0ce4da2cb5d93e1220da426587fb0d083a270f60 | [
"MIT"
] | null | null | null | tap_meltano/tests/__init__.py | Matatika/tap-meltano | 0ce4da2cb5d93e1220da426587fb0d083a270f60 | [
"MIT"
] | null | null | null | tap_meltano/tests/__init__.py | Matatika/tap-meltano | 0ce4da2cb5d93e1220da426587fb0d083a270f60 | [
"MIT"
] | null | null | null | """Test suite for tap-meltano."""
| 17 | 33 | 0.647059 |
797c29bc98eac3744351cbc691e14110fdf5f878 | 9,101 | py | Python | data_pipeline/tools/timestamp_to_offset_mapper.py | poros/data_pipeline | e143a4031b0940e17b22cdf36db0b677b46e3975 | [
"Apache-2.0"
] | 110 | 2016-11-17T18:32:25.000Z | 2022-01-03T17:27:58.000Z | data_pipeline/tools/timestamp_to_offset_mapper.py | poros/data_pipeline | e143a4031b0940e17b22cdf36db0b677b46e3975 | [
"Apache-2.0"
] | 12 | 2016-11-18T00:00:37.000Z | 2018-01-14T00:31:37.000Z | data_pipeline/tools/timestamp_to_offset_mapper.py | poros/data_pipeline | e143a4031b0940e17b22cdf36db0b677b46e3975 | [
"Apache-2.0"
] | 25 | 2016-11-18T15:00:16.000Z | 2020-10-01T13:42:47.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.473485 | 94 | 0.703 |
797c2a61642085fe544c8469821e546ac92328d0 | 54,642 | py | Python | py/dynesty/bounding.py | geoffryan/dynesty | 243025cbfc5f1941e9dc1b00348c54f8b877bd6c | [
"MIT"
] | null | null | null | py/dynesty/bounding.py | geoffryan/dynesty | 243025cbfc5f1941e9dc1b00348c54f8b877bd6c | [
"MIT"
] | null | null | null | py/dynesty/bounding.py | geoffryan/dynesty | 243025cbfc5f1941e9dc1b00348c54f8b877bd6c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bounding classes used when proposing new live points, along with a number of
useful helper functions. Bounding objects include:
UnitCube:
The unit N-cube (unconstrained draws from the prior).
Ellipsoid:
Bounding ellipsoid.
MultiEllipsoid:
... | 34.04486 | 79 | 0.579664 |
797c2b38733c3987eab3eb1e3ce1bc7eed8c1be7 | 1,574 | py | Python | espn_api/basketball/box_player.py | austinegri/espn-api | 1dea3406627fdb8c72893ca9d5553b587081e9c4 | [
"MIT"
] | 1 | 2021-11-27T16:20:34.000Z | 2021-11-27T16:20:34.000Z | espn_api/basketball/box_player.py | austinegri/espn-api | 1dea3406627fdb8c72893ca9d5553b587081e9c4 | [
"MIT"
] | null | null | null | espn_api/basketball/box_player.py | austinegri/espn-api | 1dea3406627fdb8c72893ca9d5553b587081e9c4 | [
"MIT"
] | null | null | null | from .constant import POSITION_MAP, PRO_TEAM_MAP, STATS_MAP
from .player import Player
from datetime import datetime, timedelta
class BoxPlayer(Player):
'''player with extra data from a matchup'''
def __init__(self, data, pro_schedule):
super(BoxPlayer, self).__init__(data)
self.slot_po... | 43.722222 | 119 | 0.625159 |
797c2c26c1d0ede4a5fbea245e1e3c3966b37afe | 5,384 | py | Python | edb/tools/profiling.py | tailhook/edgedb | 655230a20a6b728fe18bfe36876bb4fb918bb4d8 | [
"Apache-2.0"
] | null | null | null | edb/tools/profiling.py | tailhook/edgedb | 655230a20a6b728fe18bfe36876bb4fb918bb4d8 | [
"Apache-2.0"
] | null | null | null | edb/tools/profiling.py | tailhook/edgedb | 655230a20a6b728fe18bfe36876bb4fb918bb4d8 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-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... | 30.418079 | 79 | 0.589896 |
797c2c91e490f117829e20aaa15730e9923812b9 | 9,569 | py | Python | settings/common.py | anilchoudary/EvalAI | 584022a302d25f1b422bf56232eb759dee654588 | [
"BSD-3-Clause"
] | 1 | 2020-10-17T20:35:10.000Z | 2020-10-17T20:35:10.000Z | settings/common.py | anilchoudary/EvalAI | 584022a302d25f1b422bf56232eb759dee654588 | [
"BSD-3-Clause"
] | 65 | 2020-12-14T08:27:18.000Z | 2022-03-26T21:12:42.000Z | settings/common.py | anilchoudary/EvalAI | 584022a302d25f1b422bf56232eb759dee654588 | [
"BSD-3-Clause"
] | null | null | null | """
Django settings for evalai project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import dat... | 28.649701 | 98 | 0.665169 |
797c2ce232e1a8f6d82e0b2c2803507d14df4381 | 2,116 | py | Python | ci-scripts/configs/tmod32.py | jacwah/reframe | d650bbbb2f87c6ae5f354e50b50bcfd98fafe77b | [
"BSD-3-Clause"
] | null | null | null | ci-scripts/configs/tmod32.py | jacwah/reframe | d650bbbb2f87c6ae5f354e50b50bcfd98fafe77b | [
"BSD-3-Clause"
] | 3 | 2022-03-11T09:51:33.000Z | 2022-03-31T08:20:19.000Z | ci-scripts/configs/tmod32.py | jacwah/reframe | d650bbbb2f87c6ae5f354e50b50bcfd98fafe77b | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Generic fallback configuration
#
site_configuration = {
'systems': [
{
'name': 'generic',
... | 29.802817 | 104 | 0.366257 |
797c2d2d4cfa3f16e8781453eabd46040ae140dd | 5,827 | py | Python | DREAM_and_DeepCFR/workers/la/sampling_algorithms/MainPokerModuleFLAT_Baseline.py | EricSteinberger/DREAM | bfe21bbb0f60ab27a1af9774308efbbbd41e68c4 | [
"MIT"
] | 78 | 2020-06-21T09:45:39.000Z | 2022-03-28T11:39:38.000Z | DREAM_and_DeepCFR/workers/la/sampling_algorithms/MainPokerModuleFLAT_Baseline.py | EricSteinberger/DREAM | bfe21bbb0f60ab27a1af9774308efbbbd41e68c4 | [
"MIT"
] | 5 | 2020-06-26T05:21:57.000Z | 2021-04-11T11:03:27.000Z | DREAM_and_DeepCFR/workers/la/sampling_algorithms/MainPokerModuleFLAT_Baseline.py | EricSteinberger/DREAM | bfe21bbb0f60ab27a1af9774308efbbbd41e68c4 | [
"MIT"
] | 18 | 2020-06-22T16:05:57.000Z | 2021-11-13T07:29:34.000Z | # Copyright (c) 2019 Eric Steinberger
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from PokerRL.rl.neural.CardEmbedding import CardEmbedding
from PokerRL.rl.neural.LayerNorm import LayerNorm
class MainPokerModuleFLAT_Baseline(nn.Module):
def __init__(self,
... | 35.969136 | 113 | 0.541788 |
797c2f0961e79e64fced2edfe9b13e9df6df3427 | 432 | py | Python | chatbot_tutorial/routing.py | joseseb91/django-chat-bot | 7873b8eb53ace638c921fc16c3c386459e3932fc | [
"MIT"
] | null | null | null | chatbot_tutorial/routing.py | joseseb91/django-chat-bot | 7873b8eb53ace638c921fc16c3c386459e3932fc | [
"MIT"
] | null | null | null | chatbot_tutorial/routing.py | joseseb91/django-chat-bot | 7873b8eb53ace638c921fc16c3c386459e3932fc | [
"MIT"
] | null | null | null |
from .wsgi import * # add this line to top of your code
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.urls import path
from chatbot_tutorial import consumer
application = ProtocolTypeRouter({
'websocket': AuthMiddlewareStack(
URLRoute... | 28.8 | 86 | 0.726852 |
797c2faa70f63afd79ff18452c17cc116b544f14 | 1,783 | py | Python | tests/test_uaa.py | ONSdigital/response-operations-social-ui | 9b34f8e3261e30d732a32438e67b288e0042ed7c | [
"MIT"
] | null | null | null | tests/test_uaa.py | ONSdigital/response-operations-social-ui | 9b34f8e3261e30d732a32438e67b288e0042ed7c | [
"MIT"
] | 27 | 2018-09-26T08:46:07.000Z | 2021-04-21T07:09:53.000Z | tests/test_uaa.py | ONSdigital/response-operations-social-ui | 9b34f8e3261e30d732a32438e67b288e0042ed7c | [
"MIT"
] | 1 | 2021-04-11T08:02:48.000Z | 2021-04-11T08:02:48.000Z | import unittest
import requests_mock
from response_operations_social_ui import create_app
from response_operations_social_ui.common import uaa
class TestUaa(unittest.TestCase):
def setUp(self):
self.app = create_app('TestingConfig')
def test_get_uaa_public_key_with_config_set(self):
with s... | 40.522727 | 110 | 0.676388 |
797c30198aff21a2665ed258771107fcbf6c88a2 | 1,407 | py | Python | scripts/script_aes_custom_metrics.py | AISyLab/AISY_Framework | 51af3a639d6dee4c970859f5cd95f35f1db26dcc | [
"MIT"
] | 12 | 2021-03-26T08:17:07.000Z | 2022-01-05T22:31:19.000Z | scripts/script_aes_custom_metrics.py | AISyLab/AISY_Framework | 51af3a639d6dee4c970859f5cd95f35f1db26dcc | [
"MIT"
] | 1 | 2021-03-26T09:11:34.000Z | 2021-03-27T01:32:35.000Z | scripts/script_aes_custom_metrics.py | AISyLab/AISY_Framework | 51af3a639d6dee4c970859f5cd95f35f1db26dcc | [
"MIT"
] | 2 | 2021-03-14T01:35:49.000Z | 2021-03-31T06:43:01.000Z | import aisy_sca
from app import *
from custom.custom_models.neural_networks import *
aisy = aisy_sca.Aisy()
aisy.set_resources_root_folder(resources_root_folder)
aisy.set_database_root_folder(databases_root_folder)
aisy.set_datasets_root_folder(datasets_root_folder)
aisy.set_database_name("database_ascad.sqlite")
aisy... | 28.714286 | 64 | 0.619758 |
797c32087fd25f18d275b41f3a62944fd79804d4 | 8,655 | py | Python | mmdet/models/detectors/test_mixins.py | witnessai/GRAN | 952c2b08a58f3b0087f0f18fd48f8e385e45908b | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/test_mixins.py | witnessai/GRAN | 952c2b08a58f3b0087f0f18fd48f8e385e45908b | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/test_mixins.py | witnessai/GRAN | 952c2b08a58f3b0087f0f18fd48f8e385e45908b | [
"Apache-2.0"
] | null | null | null | from mmdet.core import (bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, merge_aug_proposals, multiclass_nms)
class RPNTestMixin(object):
def simple_test_rpn(self, x, img_meta, rpn_test_cfg):
rpn_outs = self.rpn_head(x)
proposal_inputs = rpn_outs + (img_m... | 45.078125 | 97 | 0.534835 |
797c32892c42452fa08b90793cc007e05974ef16 | 3,862 | py | Python | src/jbxmail.py | joesecurity/scripts | 4e74fc3a50f7228c10adb18a8e37cb583fa18e8b | [
"MIT"
] | 6 | 2018-06-07T03:21:52.000Z | 2021-08-20T08:46:24.000Z | src/jbxmail.py | joesecurity/scripts | 4e74fc3a50f7228c10adb18a8e37cb583fa18e8b | [
"MIT"
] | null | null | null | src/jbxmail.py | joesecurity/scripts | 4e74fc3a50f7228c10adb18a8e37cb583fa18e8b | [
"MIT"
] | 5 | 2017-10-24T11:49:20.000Z | 2021-08-20T08:46:29.000Z | #!/usr/bin/env python
from __future__ import print_function
import io
import jbxapi
import imaplib
import itertools
import email
##########################
# SETTINGS #
##########################
# imap settings
SERVER="mail.example.net"
USERNAME="username"
PASSWORD="password"
FOLDER... | 27.585714 | 102 | 0.58985 |
797c32b3b2294b3a5c48967a6ab738d0f05b45f5 | 3,517 | py | Python | app/reports/mixins.py | KubaTaba1uga/spam_recycler | 76056635fdf610c6304e8034a3f66f235761ca76 | [
"MIT"
] | 2 | 2021-12-17T18:12:51.000Z | 2021-12-17T18:12:52.000Z | app/reports/mixins.py | KubaTaba1uga/spam_recycler | 76056635fdf610c6304e8034a3f66f235761ca76 | [
"MIT"
] | null | null | null | app/reports/mixins.py | KubaTaba1uga/spam_recycler | 76056635fdf610c6304e8034a3f66f235761ca76 | [
"MIT"
] | null | null | null | from django.http.response import Http404
from django.views.generic.edit import FormMixin
from django.core.exceptions import PermissionDenied
from shared_code.queries import (
get_user_owner_reports,
get_user_guest_reports,
get_mailbox_query,
get_mailbox_owner,
validate_report_owner,
get_rep... | 28.827869 | 87 | 0.654251 |
797c3467cb3c5853116a97c98aace5711125fad0 | 6,534 | py | Python | best_protection_strategy.py | RikoNyberg/simulation_of_epidemics | 78d893279f73a324e3b8a462002ca211ab35ef78 | [
"MIT"
] | null | null | null | best_protection_strategy.py | RikoNyberg/simulation_of_epidemics | 78d893279f73a324e3b8a462002ca211ab35ef78 | [
"MIT"
] | null | null | null | best_protection_strategy.py | RikoNyberg/simulation_of_epidemics | 78d893279f73a324e3b8a462002ca211ab35ef78 | [
"MIT"
] | 1 | 2019-09-14T08:18:28.000Z | 2019-09-14T08:18:28.000Z | import random
from sklearn.datasets import base
import numpy as np
import networkx as nx
# Task 5
def get_immunized_random(epidemic_graph, n_nodes):
nodes_to_immunize = random.sample(range(len(epidemic_graph)), n_nodes)
return nodes_to_immunize
def get_immunized_neighbors(epidemic_graph, n_nodes):
immunized_ne... | 41.617834 | 129 | 0.781145 |
797c34b532125ddf3fe09e64da26961c6d45e3ef | 470 | py | Python | setup.py | ibm-research-tokyo/dybm | a6d308c896c2f66680ee9c5d05a3d7826cc27c64 | [
"Apache-2.0"
] | 126 | 2017-09-04T11:53:26.000Z | 2022-02-22T12:47:56.000Z | setup.py | rraymondhp/dybm | 3d618874a2f8838eaeca17ce40649a3789e9f140 | [
"Apache-2.0"
] | 8 | 2017-10-14T03:26:16.000Z | 2020-12-22T22:22:42.000Z | setup.py | ibm-research-tokyo/dybm | a6d308c896c2f66680ee9c5d05a3d7826cc27c64 | [
"Apache-2.0"
] | 41 | 2017-09-04T13:40:23.000Z | 2022-03-02T14:02:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" setup file for DyBM. """
__author__ = "Hiroshi Kajino"
__version__ = "3.2"
__date__ = "December 22, 2016"
__copyright__ = "(C) Copyright IBM Corp. 2016"
from setuptools import setup, find_packages
import sys
import os
setup(
name = "pydybm",
version = "3.2.1... | 21.363636 | 55 | 0.640426 |
797c35fd52d7119d5b7647521345e83a25b933db | 143,713 | py | Python | youtube_dl/extractor/common.py | jonyg80/youtube-dl | ef3a87fb77891329de1d3dbebfee53bf50645261 | [
"Unlicense"
] | 66,635 | 2019-03-10T21:34:18.000Z | 2022-03-31T23:50:31.000Z | youtube_dl/extractor/common.py | jonyg80/youtube-dl | ef3a87fb77891329de1d3dbebfee53bf50645261 | [
"Unlicense"
] | 10,936 | 2019-03-10T21:35:47.000Z | 2022-03-31T23:46:52.000Z | youtube_dl/extractor/common.py | jonyg80/youtube-dl | ef3a87fb77891329de1d3dbebfee53bf50645261 | [
"Unlicense"
] | 15,194 | 2019-03-10T21:09:27.000Z | 2022-03-31T22:13:49.000Z | # coding: utf-8
from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import random
import re
import socket
import ssl
import sys
import time
import math
from ..compat import (
compat_cookiejar_Cookie,
compat_cookies_SimpleCookie,
compat_et... | 46.888418 | 172 | 0.546798 |
797c363c9abcb777dda01422d77b24ff960327a5 | 2,139 | py | Python | nuscenes_flicker/vis_iso.py | jianrenw/SOD-TGNN | 2533508f9565edee71af96202086ecc688b3dfe0 | [
"MIT"
] | 1 | 2022-03-29T12:04:32.000Z | 2022-03-29T12:04:32.000Z | nuscenes_flicker/vis_iso.py | jianrenw/SOD-TGNN | 2533508f9565edee71af96202086ecc688b3dfe0 | [
"MIT"
] | 1 | 2022-02-18T08:17:52.000Z | 2022-03-30T07:40:24.000Z | nuscenes_flicker/vis_iso.py | jianrenw/SOD-TGNN | 2533508f9565edee71af96202086ecc688b3dfe0 | [
"MIT"
] | null | null | null | import numpy as np
import json
import argparse
import os
import os.path as osp
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser()
parser.add_argument('--det_dir', type=str)
parser.add_argument('--output_dir', type=str)
parser.add_argument('--linear', type=int)
args = parser.parse_args()
with open(arg... | 36.87931 | 98 | 0.627863 |
797c369c02986ef179cae51d62b29c3351d721b3 | 405 | py | Python | examples/django_app/example_app/wsgi.py | gugux289/chatterbot | 0c4e38877a8a43458ac925444bb11d08aa5976fe | [
"BSD-3-Clause"
] | 13,200 | 2015-01-04T07:35:03.000Z | 2022-03-31T15:06:07.000Z | examples/django_app/example_app/wsgi.py | gugux289/chatterbot | 0c4e38877a8a43458ac925444bb11d08aa5976fe | [
"BSD-3-Clause"
] | 1,782 | 2015-01-01T12:12:05.000Z | 2022-03-29T10:21:46.000Z | examples/django_app/example_app/wsgi.py | gugux289/chatterbot | 0c4e38877a8a43458ac925444bb11d08aa5976fe | [
"BSD-3-Clause"
] | 4,886 | 2015-01-03T12:59:25.000Z | 2022-03-30T08:21:03.000Z | """
WSGI config for django_chatterbot project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJ... | 23.823529 | 78 | 0.792593 |
797c36dc936a2ab6dba899606e1590a260858107 | 787 | py | Python | db_middleware/forms.py | ChrisLi03/WatchDOG | 8452d2a06f73e03977aa35524b4220f25033a921 | [
"MIT"
] | null | null | null | db_middleware/forms.py | ChrisLi03/WatchDOG | 8452d2a06f73e03977aa35524b4220f25033a921 | [
"MIT"
] | null | null | null | db_middleware/forms.py | ChrisLi03/WatchDOG | 8452d2a06f73e03977aa35524b4220f25033a921 | [
"MIT"
] | 1 | 2021-04-13T16:25:10.000Z | 2021-04-13T16:25:10.000Z | '''
This file all request form of this project
'''
from flask_restplus import fields
login_form = {'username': fields.String(default='string: username',example="1259540", required=True),
'password': fields.String(default='string: password',example="Passw0rd!" ,required=True)}
reg_form = {#'name': fields.String... | 46.294118 | 102 | 0.719187 |
797c36f0d3eae4ec50ab1ef9a060d082506b71b0 | 4,498 | py | Python | yolox/utils/visualize.py | Aeocp/SpeedDetect_DeepSORT_YOLOX | 35048d4753173ee739bb9e855c3227f844a8a8b0 | [
"Apache-2.0"
] | 1 | 2022-01-30T09:01:41.000Z | 2022-01-30T09:01:41.000Z | yolox/utils/visualize.py | Aeocp/SpeedDetect_DeepSORT_YOLOX | 35048d4753173ee739bb9e855c3227f844a8a8b0 | [
"Apache-2.0"
] | null | null | null | yolox/utils/visualize.py | Aeocp/SpeedDetect_DeepSORT_YOLOX | 35048d4753173ee739bb9e855c3227f844a8a8b0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
import cv2
import numpy as np
import mmglobal
__all__ = ["vis"]
def vis(img, boxes, scores, cls_ids, conf=0.5, class_names=None):
with open("/content/test.txt", "a") as writefile:
writefile.write("# F... | 30.598639 | 137 | 0.476656 |
797c375ffb841431e0309c43453f0cd6e3a82368 | 3,223 | py | Python | L1Trigger/DTTriggerPhase2/test/test_primitivesPhase2Prod_over_dTDigis_and_4Dsegments_cfg.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | L1Trigger/DTTriggerPhase2/test/test_primitivesPhase2Prod_over_dTDigis_and_4Dsegments_cfg.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | L1Trigger/DTTriggerPhase2/test/test_primitivesPhase2Prod_over_dTDigis_and_4Dsegments_cfg.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
process = cms.Process("L1DTTrigPhase2Prod")
process.load('Configuration.Geometry.GeometryExtended2026D41Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2026D41_cff')
process.load("L1Trigger.DTTriggerPhase2.dtTriggerPhase2PrimitiveDigis_cfi")
process.load("Conf... | 42.973333 | 180 | 0.786845 |
797c3975de0a3164b9b5549fad699364f19ec94e | 2,986 | py | Python | downloader.py | anniecherk/advent_of_code_2020_python | 12e58c62b18346a61d45e78bd5d47c94e0754519 | [
"MIT"
] | null | null | null | downloader.py | anniecherk/advent_of_code_2020_python | 12e58c62b18346a61d45e78bd5d47c94e0754519 | [
"MIT"
] | null | null | null | downloader.py | anniecherk/advent_of_code_2020_python | 12e58c62b18346a61d45e78bd5d47c94e0754519 | [
"MIT"
] | null | null | null | # copied verbatim from https://github.com/mcpower/adventofcode/blob/15ae109bc882ca688665f86e4ca2ba1770495bb4/utils.py#L480
import sys
def get_actual(day=None, year=None):
try:
actual_input = open("input.txt").read()
print("Found existing input.txt, aborting.")
return actual_input
except... | 35.975904 | 122 | 0.613195 |
797c399da97359a0917c53f5c031b85c61d003db | 101 | py | Python | 04_division.py | b-husein/HackerRank_Python_Challenges | 655b38e7e9fb23864eb56b72f647fee585159af6 | [
"MIT"
] | null | null | null | 04_division.py | b-husein/HackerRank_Python_Challenges | 655b38e7e9fb23864eb56b72f647fee585159af6 | [
"MIT"
] | 13 | 2021-03-10T08:46:52.000Z | 2022-03-02T08:13:58.000Z | 04_division.py | b-husein/HackerRank_Python_Challenges | 655b38e7e9fb23864eb56b72f647fee585159af6 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
a = int(input())
b = int(input())
print(a//b)
print(a/b)
| 14.428571 | 26 | 0.49505 |
797c39da59a4708a708b56ad363eb30baaf51bd7 | 10,146 | py | Python | contrib/build-wine/dist/electrum/gui/kivy/uix/dialogs/settings.py | justthedoctor/funk-electrum | 6b7ad79f4c0e7394e484cb0df06ab280835e790b | [
"MIT"
] | 1 | 2017-01-20T16:23:26.000Z | 2017-01-20T16:23:26.000Z | gui/kivy/uix/dialogs/settings.py | justthedoctor/funk-electrum | 6b7ad79f4c0e7394e484cb0df06ab280835e790b | [
"MIT"
] | null | null | null | gui/kivy/uix/dialogs/settings.py | justthedoctor/funk-electrum | 6b7ad79f4c0e7394e484cb0df06ab280835e790b | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from electrum.util import base_units
from electrum.i18n import languages
from electrum_gui.kivy.i18n import _
from electrum.plugins import run_hook
from electrum.bitcoin import RECOMMENDED... | 39.023077 | 143 | 0.578947 |
797c3c07b59a0436d1841a704164d78903da1a0d | 1,178 | py | Python | excelhash.py | wholl0p/ExcelHash | f8a5f01f4293813044b839983fb9a9217f674ddd | [
"Apache-2.0"
] | 1 | 2019-02-26T22:18:21.000Z | 2019-02-26T22:18:21.000Z | excelhash.py | wholl0p/ExcelHash | f8a5f01f4293813044b839983fb9a9217f674ddd | [
"Apache-2.0"
] | null | null | null | excelhash.py | wholl0p/ExcelHash | f8a5f01f4293813044b839983fb9a9217f674ddd | [
"Apache-2.0"
] | null | null | null | # created by wholl0p
# v1.0 30.09.2017
import hashlib
import openpyxl
md5 = hashlib.new("md5")
sha1 = hashlib.new("SHA1")
def create_hash_values(doc_path, DATA_COLUMN):
wb = openpyxl.load_workbook(doc_path)
sheet = wb.active
for i in range(1, sheet.max_row + 1):
cell_value = sheet.cell(row=i, column=DATA_COLUM... | 27.395349 | 89 | 0.696944 |
797c3c847cc9fbfaf9e879eb7a46dbff90ddd57c | 13,539 | py | Python | bin/process_plug_in_packages.py | hyche/openbmc-test-automation | 1e656463b8db4fc55dc1a2bf7650d1bca845f958 | [
"Apache-2.0"
] | null | null | null | bin/process_plug_in_packages.py | hyche/openbmc-test-automation | 1e656463b8db4fc55dc1a2bf7650d1bca845f958 | [
"Apache-2.0"
] | null | null | null | bin/process_plug_in_packages.py | hyche/openbmc-test-automation | 1e656463b8db4fc55dc1a2bf7650d1bca845f958 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import __builtin__
import subprocess
import os
import argparse
# python puts the program's directory path in sys.path[0]. In other words,
# the user ordinarily has no way to override python's choice of a module from
# its own dir. We want to have that ability in our environment. Ho... | 38.138028 | 79 | 0.609277 |
797c3dec07bf40a3a3473a22cc8453c391deda7f | 532 | py | Python | plog/working7.py | Strangemother/PlogBlock | e791215b197e1e06daa569742a118b88dc8a25ac | [
"MIT"
] | null | null | null | plog/working7.py | Strangemother/PlogBlock | e791215b197e1e06daa569742a118b88dc8a25ac | [
"MIT"
] | null | null | null | plog/working7.py | Strangemother/PlogBlock | e791215b197e1e06daa569742a118b88dc8a25ac | [
"MIT"
] | null | null | null | from api import Plog
from patterns import PlogLine, PlogBlock as Block
block = Block('Device ID:', ref='Device')
#block.header.ref='device_id'
line = PlogLine(ref='ip')
line.startswith('IP address:')
block.add_line(line)
block.footer = PlogLine('----------', ref='footer').anything()
# new parser
f = open('test_dat... | 19.703704 | 62 | 0.674812 |
797c3e467a2566aeb5a8c03e185d1df0b4b349b2 | 11 | py | Python | Morphology/binary_dilation.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | Morphology/binary_dilation.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | Morphology/binary_dilation.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | # ่ฎก็ฎไบ่ฟๅถๅพ็ๅธๅ
| 11 | 11 | 0.818182 |
797c3e522a7d21cf72e911af51824d40242e6735 | 18,436 | py | Python | apps/generative_models/sketch_vae.py | AntonBiryukovUofC/diffvg | e081098f52b82bfd0b7e91114d289d65ef969a60 | [
"Apache-2.0"
] | 488 | 2020-09-04T07:23:18.000Z | 2022-03-31T13:59:25.000Z | apps/generative_models/sketch_vae.py | AntonBiryukovUofC/diffvg | e081098f52b82bfd0b7e91114d289d65ef969a60 | [
"Apache-2.0"
] | 38 | 2020-09-04T19:27:24.000Z | 2022-03-24T01:13:45.000Z | apps/generative_models/sketch_vae.py | AntonBiryukovUofC/diffvg | e081098f52b82bfd0b7e91114d289d65ef969a60 | [
"Apache-2.0"
] | 75 | 2020-09-04T19:18:47.000Z | 2022-03-18T22:25:22.000Z | #!/bin/env python
"""Train a Sketch-VAE."""
import argparse
from enum import Enum
import os
import wget
import time
import numpy as np
import torch as th
from torch.utils.data import DataLoader
import torchvision.datasets as dset
import torchvision.transforms as transforms
import ttools
import ttools.interfaces
from ... | 35.11619 | 88 | 0.58977 |
797c3e951e421670dbb602c1782213db3a6c0f8c | 26 | py | Python | Dalitz/__init__.py | weissercn/MLTools | 75dc566947437249ad077939941839126eb20016 | [
"MIT"
] | null | null | null | Dalitz/__init__.py | weissercn/MLTools | 75dc566947437249ad077939941839126eb20016 | [
"MIT"
] | null | null | null | Dalitz/__init__.py | weissercn/MLTools | 75dc566947437249ad077939941839126eb20016 | [
"MIT"
] | null | null | null | import goodness_of_fit
| 6.5 | 23 | 0.807692 |
797c3ef951f98f5a982b08b2a84104a687fd37d8 | 4,510 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py | hurtn/azure-sdk-for-python | 64cc053e589691da22fed7a47611199818c99b2b | [
"MIT"
] | 1 | 2020-12-10T03:17:51.000Z | 2020-12-10T03:17:51.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py | hurtn/azure-sdk-for-python | 64cc053e589691da22fed7a47611199818c99b2b | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py | hurtn/azure-sdk-for-python | 64cc053e589691da22fed7a47611199818c99b2b | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 42.149533 | 106 | 0.65388 |
797c3f453c0976eaebc5088afd3ae67fff11b0e8 | 1,493 | py | Python | biosteam/units/facilities/__init__.py | EVBiotechBV/biosteam | c31c5998c6f6a52f9e06daba0ddc73bdee78a07a | [
"MIT"
] | 73 | 2020-03-04T20:14:07.000Z | 2022-03-14T00:35:18.000Z | biosteam/units/facilities/__init__.py | EVBiotechBV/biosteam | c31c5998c6f6a52f9e06daba0ddc73bdee78a07a | [
"MIT"
] | 74 | 2020-03-06T11:47:32.000Z | 2022-03-31T17:55:24.000Z | biosteam/units/facilities/__init__.py | EVBiotechBV/biosteam | c31c5998c6f6a52f9e06daba0ddc73bdee78a07a | [
"MIT"
] | 19 | 2020-03-06T13:59:27.000Z | 2022-02-22T15:24:21.000Z | # -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020-2021, Yoel Cortes-Pena <yoelcortes@gmail.com>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details... | 32.456522 | 75 | 0.755526 |
797c3f82a457128dcf908efffb867e8325737a34 | 9,465 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 62.682119 | 526 | 0.781828 |
797c4033fcb2a291464dd384c66d98daf57a1753 | 187 | py | Python | Akaton_2/akaton_2_code/romberg_integration.py | SCE-SWE-2018-G11/NumericAnalysis | eddca9b35598110227a41de3fa1ed24504b07209 | [
"MIT"
] | null | null | null | Akaton_2/akaton_2_code/romberg_integration.py | SCE-SWE-2018-G11/NumericAnalysis | eddca9b35598110227a41de3fa1ed24504b07209 | [
"MIT"
] | null | null | null | Akaton_2/akaton_2_code/romberg_integration.py | SCE-SWE-2018-G11/NumericAnalysis | eddca9b35598110227a41de3fa1ed24504b07209 | [
"MIT"
] | 1 | 2018-11-25T10:08:17.000Z | 2018-11-25T10:08:17.000Z |
from scipy import integrate
import numpy as np
def romberg(f, a, b):
return integrate.romberg(f, a, b, show=True)
print("Integral: ", romberg(lambda x: 1/(1+ x**5), 0, 3))
| 20.777778 | 58 | 0.631016 |
797c40454343188834494020a2ebfe2f58978717 | 3,684 | py | Python | docs/source/snippets/deterministic_model.py | simonbogh/skrl | 4ca483c7d24fdf020bdbd9422927ef5737c9dec4 | [
"MIT"
] | 43 | 2021-12-19T07:47:43.000Z | 2022-03-31T05:24:42.000Z | docs/source/snippets/deterministic_model.py | simonbogh/skrl | 4ca483c7d24fdf020bdbd9422927ef5737c9dec4 | [
"MIT"
] | 5 | 2022-01-05T07:54:13.000Z | 2022-03-08T21:00:39.000Z | docs/source/snippets/deterministic_model.py | simonbogh/skrl | 4ca483c7d24fdf020bdbd9422927ef5737c9dec4 | [
"MIT"
] | 1 | 2022-01-31T17:53:52.000Z | 2022-01-31T17:53:52.000Z | import gym
class DummyEnv:
observation_space = gym.spaces.Box(low=-1, high=1, shape=(4,))
action_space = gym.spaces.Box(low=-1, high=1, shape=(3,))
device = "cuda:0"
env = DummyEnv()
# [start-mlp]
import torch
import torch.nn as nn
from skrl.models.torch import DeterministicModel
# define the model
cl... | 36.475248 | 106 | 0.535016 |
797c410548952bc85ccbe0669429ac28068bfc86 | 5,839 | py | Python | src/python/pants/backend/codegen/protobuf/python/python_protobuf_subsystem.py | bastianwegge/pants | 43f0b90d41622bee0ed22249dbaffb3ff4ad2eb2 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/codegen/protobuf/python/python_protobuf_subsystem.py | bastianwegge/pants | 43f0b90d41622bee0ed22249dbaffb3ff4ad2eb2 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/codegen/protobuf/python/python_protobuf_subsystem.py | bastianwegge/pants | 43f0b90d41622bee0ed22249dbaffb3ff4ad2eb2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.codegen.protobuf.target_types import (
ProtobufDependenciesField,
ProtobufGrpcToggleField,
)
from pants.backend.codegen.utils import find_python_runtime_library... | 40.268966 | 103 | 0.728892 |
797c422cb17ab3570916cc25af841ac78ee7e953 | 22,565 | py | Python | src/fermilib/utils/_dual_basis_trotter_error.py | ProjectQ-Framework/FermiLib | 9aef7d5a912ebe759a2877c8aea5754a4db93543 | [
"Apache-2.0"
] | 102 | 2017-05-01T05:54:20.000Z | 2022-02-17T09:30:03.000Z | src/fermilib/utils/_dual_basis_trotter_error.py | ProjectQ-Framework/FermiLib | 9aef7d5a912ebe759a2877c8aea5754a4db93543 | [
"Apache-2.0"
] | 87 | 2017-05-08T08:44:16.000Z | 2018-03-07T07:27:50.000Z | src/fermilib/utils/_dual_basis_trotter_error.py | ProjectQ-Framework/FermiLib | 9aef7d5a912ebe759a2877c8aea5754a4db93543 | [
"Apache-2.0"
] | 67 | 2017-05-08T08:01:51.000Z | 2022-01-05T18:55:13.000Z | # Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... | 43.145315 | 79 | 0.648837 |
797c42c7285fec4269910e7d733e3598bedc7b5a | 6,155 | py | Python | src/ADBSync/FileSystems/Base.py | SelfAdjointOperator/adb-sync | 38b339ab9147512a13a767ba9065c59c7eb2072c | [
"Apache-2.0"
] | null | null | null | src/ADBSync/FileSystems/Base.py | SelfAdjointOperator/adb-sync | 38b339ab9147512a13a767ba9065c59c7eb2072c | [
"Apache-2.0"
] | null | null | null | src/ADBSync/FileSystems/Base.py | SelfAdjointOperator/adb-sync | 38b339ab9147512a13a767ba9065c59c7eb2072c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from typing import Iterable, Iterator, List, Tuple, Union
import logging
import os
import stat
import subprocess
class FileSystem():
def __init__(self, adb_arguments: List[str]) -> None:
self.adb_arguments = adb_arguments
def adbShell(self, commands: List[str]) -> Iterator[str]... | 42.157534 | 117 | 0.601462 |
797c430e99b21a73a2260d45d6c9f25e26122806 | 15,075 | py | Python | tensorflow/python/profiler/internal/print_model_analysis_test.py | DEVESHTARASIA/tensorflow | d3edb8c60ed4fd831d62833ed22f5c23486c561c | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/python/profiler/internal/print_model_analysis_test.py | ChenAugustus/tensorflow | 5828e285209ff8c3d1bef2e4bd7c55ca611080d5 | [
"Apache-2.0"
] | 48 | 2016-07-26T00:11:55.000Z | 2022-02-23T13:36:33.000Z | tensorflow/python/profiler/internal/print_model_analysis_test.py | ChenAugustus/tensorflow | 5828e285209ff8c3d1bef2e4bd7c55ca611080d5 | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.670168 | 80 | 0.463018 |
797c43351215b36bb2f1981a192df51ab3596692 | 194 | py | Python | blaze/expr/scalar/tests/test_core_expr_scalar.py | chdoig/blaze | caa5a497e1ca1ceb1cf585483312ff4cd74d0bda | [
"BSD-3-Clause"
] | 1 | 2015-01-18T23:59:57.000Z | 2015-01-18T23:59:57.000Z | blaze/expr/scalar/tests/test_core_expr_scalar.py | chdoig/blaze | caa5a497e1ca1ceb1cf585483312ff4cd74d0bda | [
"BSD-3-Clause"
] | null | null | null | blaze/expr/scalar/tests/test_core_expr_scalar.py | chdoig/blaze | caa5a497e1ca1ceb1cf585483312ff4cd74d0bda | [
"BSD-3-Clause"
] | null | null | null | from blaze.expr.scalar import ScalarSymbol
from datashape import dshape
def test_basic():
x = ScalarSymbol('x', 'real')
assert eval(str(x)) == x
assert x.dshape == dshape('real')
| 19.4 | 42 | 0.675258 |
797c4378476d5fb43c0d336cba09af020de55be6 | 255 | py | Python | rocketgram/connectors/__init__.py | waneroy/rocketgram | b84d12772a743a534878e417cd8c1f3c7d4ace1f | [
"MIT"
] | null | null | null | rocketgram/connectors/__init__.py | waneroy/rocketgram | b84d12772a743a534878e417cd8c1f3c7d4ace1f | [
"MIT"
] | null | null | null | rocketgram/connectors/__init__.py | waneroy/rocketgram | b84d12772a743a534878e417cd8c1f3c7d4ace1f | [
"MIT"
] | 1 | 2021-02-26T14:21:59.000Z | 2021-02-26T14:21:59.000Z | # Copyright (C) 2015-2019 by Vd.
# This file is part of RocketGram, the modern Telegram bot framework.
# RocketGram is released under the MIT License (see LICENSE).
from .aiohttpconnector import AioHttpConnector
from .baseconnector import BaseConnector
| 31.875 | 69 | 0.796078 |
797c439ca5c5b0d76404a2454fd25f2ffc392b0f | 167 | py | Python | data/groups.py | SVLEBEDEV/python_training | c8ae77188e82ab8f7bf19af0b144adf0fe04a80e | [
"Apache-2.0"
] | null | null | null | data/groups.py | SVLEBEDEV/python_training | c8ae77188e82ab8f7bf19af0b144adf0fe04a80e | [
"Apache-2.0"
] | null | null | null | data/groups.py | SVLEBEDEV/python_training | c8ae77188e82ab8f7bf19af0b144adf0fe04a80e | [
"Apache-2.0"
] | null | null | null | from model.group import Group
TestData = [
Group(name="name1", header="header1", footer="footer1"),
Group(name="name2", header="header2", footer="footer3")
] | 23.857143 | 60 | 0.676647 |
797c43d5c9d8a5f6d8891bba1451282183b00952 | 782 | py | Python | pipe/constants.py | IamGianluca/petfinder-pawpularity-score | 955471a031ac14f7447f5ecf1b1a2423073f1bf4 | [
"MIT"
] | null | null | null | pipe/constants.py | IamGianluca/petfinder-pawpularity-score | 955471a031ac14f7447f5ecf1b1a2423073f1bf4 | [
"MIT"
] | null | null | null | pipe/constants.py | IamGianluca/petfinder-pawpularity-score | 955471a031ac14f7447f5ecf1b1a2423073f1bf4 | [
"MIT"
] | null | null | null | from pathlib import Path
# paths
path = Path("/workspace")
ckpts_path = path / "ckpts"
data_path = path / "data"
metrics_path = path / "metrics"
train_images_path = data_path / "train"
test_images_path = data_path / "test"
adoption_images_path = data_path / "extra"
dogsvscats_images_path = data_path / "extra2"
# ful... | 26.965517 | 57 | 0.76087 |
797c456b0c71a171004f3aabe8b6398342cb98a2 | 13,943 | py | Python | tensorflow_model_analysis/metrics/calibration_plot_test.py | jaymessina3/model-analysis | 8638ad375d860a97df5938850c59c72b0def995a | [
"Apache-2.0"
] | 1,118 | 2018-03-30T02:01:17.000Z | 2022-03-22T07:25:58.000Z | tensorflow_model_analysis/metrics/calibration_plot_test.py | jaymessina3/model-analysis | 8638ad375d860a97df5938850c59c72b0def995a | [
"Apache-2.0"
] | 82 | 2018-04-12T12:54:05.000Z | 2022-03-31T11:14:31.000Z | tensorflow_model_analysis/metrics/calibration_plot_test.py | jaymessina3/model-analysis | 8638ad375d860a97df5938850c59c72b0def995a | [
"Apache-2.0"
] | 280 | 2018-03-30T15:58:02.000Z | 2022-03-21T07:41:53.000Z | # Lint as: python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 31.332584 | 75 | 0.470774 |
797c4642b71ea652024823184ce2c8fbde493ff0 | 3,216 | py | Python | openverse-api/catalog/api/utils/scheduled_tasks.py | taka1226/openverse-api | 754b7bd820b80019b3de76b781f4e98b783757d1 | [
"MIT"
] | 1 | 2022-01-29T05:33:37.000Z | 2022-01-29T05:33:37.000Z | openverse-api/catalog/api/utils/scheduled_tasks.py | wenxuefeng3930/openverse-api | 5fedb5e20db71bf58c09004f10f966cedb8a6e89 | [
"MIT"
] | null | null | null | openverse-api/catalog/api/utils/scheduled_tasks.py | wenxuefeng3930/openverse-api | 5fedb5e20db71bf58c09004f10f966cedb8a6e89 | [
"MIT"
] | null | null | null | from django_cron import CronJobBase, Schedule
from django_redis import get_redis_connection
from django.core.exceptions import ObjectDoesNotExist
from catalog.api.models import Image
import logging as log
import time
"""
Cron-like tasks run at a set interval. `python3 manage.py runcrons` will
execute any scheduled task... | 41.230769 | 80 | 0.678172 |
797c468fdc05d8a2d444ae6811776786454f75e3 | 65,302 | py | Python | pkg/Python27/Lib/site-packages/setuptools/command/easy_install.py | jkolokotronis/ds_mod_tools | d9fd4def34f6adfd0e2b176d0a9bf2a3dfd43f93 | [
"MIT"
] | null | null | null | pkg/Python27/Lib/site-packages/setuptools/command/easy_install.py | jkolokotronis/ds_mod_tools | d9fd4def34f6adfd0e2b176d0a9bf2a3dfd43f93 | [
"MIT"
] | null | null | null | pkg/Python27/Lib/site-packages/setuptools/command/easy_install.py | jkolokotronis/ds_mod_tools | d9fd4def34f6adfd0e2b176d0a9bf2a3dfd43f93 | [
"MIT"
] | null | null | null | #!python
"""\
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ http://peak.telecommunity.com/DevCenter/EasyInstall
"""
import sys... | 37.900174 | 90 | 0.560733 |
797c46aecc85c0b953ec9c046f56b92d2dfc7b3c | 4,232 | py | Python | astrofunc/LensingProfiles/sis_truncate.py | LBJ-Wade/astrofunc_lensing_profile | d2223705bc44d07575a5e93291375ab8e69ebfa8 | [
"MIT"
] | null | null | null | astrofunc/LensingProfiles/sis_truncate.py | LBJ-Wade/astrofunc_lensing_profile | d2223705bc44d07575a5e93291375ab8e69ebfa8 | [
"MIT"
] | null | null | null | astrofunc/LensingProfiles/sis_truncate.py | LBJ-Wade/astrofunc_lensing_profile | d2223705bc44d07575a5e93291375ab8e69ebfa8 | [
"MIT"
] | null | null | null | __author__ = 'sibirrer'
import numpy as np
class SIS_truncate(object):
"""
this class contains the function and the derivatives of the Singular Isothermal Sphere
"""
def function(self, x, y, theta_E, r_trunc, center_x=0, center_y=0):
x_shift = x - center_x
y_shift = y - center_y
... | 31.348148 | 124 | 0.474716 |
797c46d8bc359e349b987a84dd9b2932a7287927 | 906 | py | Python | scripts/repl.py | Yet-Another-Data-Aggregator/yada-datastore-tools | f1f968fd0ca679558c57e1781a7ec0a239fcf96b | [
"MIT"
] | null | null | null | scripts/repl.py | Yet-Another-Data-Aggregator/yada-datastore-tools | f1f968fd0ca679558c57e1781a7ec0a239fcf96b | [
"MIT"
] | null | null | null | scripts/repl.py | Yet-Another-Data-Aggregator/yada-datastore-tools | f1f968fd0ca679558c57e1781a7ec0a239fcf96b | [
"MIT"
] | null | null | null | """
YADA datastore tools used to quickly moderate and reset data in the datastore during development, as well as simulate functioning hvac data logging.
"""
import os.path
from os import path
import firestore
if not path.exists('./scripts/ServiceAccountKey.json'):
print("Firestore secret access key is required to ... | 34.846154 | 190 | 0.687638 |
797c46fe07909023a4924535137815b68ff1022e | 6,312 | py | Python | src/test/test_opensub.py | rubasov/opensub-utils | b6bd68f9c198f6b73aeb53429a3b161dbd197286 | [
"BSD-2-Clause"
] | 2 | 2018-06-28T15:55:25.000Z | 2020-05-02T05:44:36.000Z | src/test/test_opensub.py | rubasov/opensub-utils | b6bd68f9c198f6b73aeb53429a3b161dbd197286 | [
"BSD-2-Clause"
] | null | null | null | src/test/test_opensub.py | rubasov/opensub-utils | b6bd68f9c198f6b73aeb53429a3b161dbd197286 | [
"BSD-2-Clause"
] | null | null | null | import errno
import os
import sys
import tempfile
import unittest
from os.path import join
# Make it possible to run out of the working copy.
sys.path.insert(
0,
os.path.join(
os.path.dirname(__file__),
os.pardir,
"lib",
))
import opensub # noqa
import opensub.main # noqa
... | 25.975309 | 77 | 0.555925 |
797c4846c9e1ee8c6334955c207095ff25ec7849 | 324,333 | py | Python | nova/virt/libvirt/driver.py | JohnGarbutt/nova | 21f6f7b63af920aa3a5501603c3debbcd5ec5bc5 | [
"Apache-2.0"
] | null | null | null | nova/virt/libvirt/driver.py | JohnGarbutt/nova | 21f6f7b63af920aa3a5501603c3debbcd5ec5bc5 | [
"Apache-2.0"
] | null | null | null | nova/virt/libvirt/driver.py | JohnGarbutt/nova | 21f6f7b63af920aa3a5501603c3debbcd5ec5bc5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... | 44.612517 | 79 | 0.571832 |
797c484af49ff23750861a13bf25d6a38faa780e | 3,577 | py | Python | shresth/shresth/settings.py | rnk20/docker-test | f6cbfeff813421e7b33bc84ce3d62673f36b492f | [
"MIT"
] | null | null | null | shresth/shresth/settings.py | rnk20/docker-test | f6cbfeff813421e7b33bc84ce3d62673f36b492f | [
"MIT"
] | 10 | 2020-01-28T22:27:41.000Z | 2022-02-09T23:55:54.000Z | shresth/shresth/settings.py | rnk20/docker-test | f6cbfeff813421e7b33bc84ce3d62673f36b492f | [
"MIT"
] | null | null | null | """
Django settings for shresth project.
Generated by 'django-admin startproject' using Django 2.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
#... | 25.55 | 91 | 0.69891 |
797c492c2925a7da45841b4564e331b4312cf6eb | 13,210 | py | Python | tests/unit/modules/test_win_file.py | LuAPi/salt | 67f1458975f2b3817948af679895005f66470a3a | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_win_file.py | LuAPi/salt | 67f1458975f2b3817948af679895005f66470a3a | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_win_file.py | LuAPi/salt | 67f1458975f2b3817948af679895005f66470a3a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: Shane Lee <slee@saltstack.com>
'''
# Import Python Libs
from __future__ import absolute_import, unicode_literals, print_function
import os
import tempfile
# Import Salt Testing Libs
from tests.support.helpers import destructiveTest
from tests.support.mixins import LoaderModuleM... | 40.151976 | 80 | 0.539818 |
797c49a8a9743e863ee419d0db73304c21c0c6b4 | 1,014 | py | Python | viewModel.py | mshafer1/SunRiseAlarm | f1140238a9705c2c771a328619908aa7218a439e | [
"MIT"
] | null | null | null | viewModel.py | mshafer1/SunRiseAlarm | f1140238a9705c2c771a328619908aa7218a439e | [
"MIT"
] | null | null | null | viewModel.py | mshafer1/SunRiseAlarm | f1140238a9705c2c771a328619908aa7218a439e | [
"MIT"
] | null | null | null | import database
import alarmComposite
from alarm import Alarm
import LEDController
import time
from repeatedTimer import RepeatedTimer
class ViewModel(object):
def __init__(self):
self.db = database.DB("alarms.json")
self.alarms = alarmComposite.AlarmComposite()
self.led = LEDController.L... | 21.574468 | 64 | 0.646943 |
797c4a55e5d78e236131d06bf4b384d50b8c4bd1 | 9,829 | py | Python | tcorr_image/utils.py | gregory-halverson/openet-ssebop-beta | 30dc9b626c5e62b417181731d9c57fa11f14fc94 | [
"Apache-2.0"
] | 1 | 2021-04-05T16:41:45.000Z | 2021-04-05T16:41:45.000Z | tcorr_image/utils.py | gregory-halverson/openet-ssebop-beta | 30dc9b626c5e62b417181731d9c57fa11f14fc94 | [
"Apache-2.0"
] | null | null | null | tcorr_image/utils.py | gregory-halverson/openet-ssebop-beta | 30dc9b626c5e62b417181731d9c57fa11f14fc94 | [
"Apache-2.0"
] | 1 | 2020-08-19T22:48:37.000Z | 2020-08-19T22:48:37.000Z | import argparse
import calendar
import configparser
import datetime
import logging
import os
import sys
import time
import ee
def arg_valid_file(file_path):
"""Argparse specific function for testing if file exists
Convert relative paths to absolute paths
"""
if os.path.isfile(os.path.abspath(os.path... | 31.203175 | 86 | 0.565876 |
797c4ab85c45a3da7e2bba2fa83bba5a7721c586 | 35,331 | py | Python | pytorch_lightning/trainer/training_loop.py | ksasi/pytorch-lightning | 0009f29848a62d6a05226ec503631c3d4ed5081e | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/training_loop.py | ksasi/pytorch-lightning | 0009f29848a62d6a05226ec503631c3d4ed5081e | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/training_loop.py | ksasi/pytorch-lightning | 0009f29848a62d6a05226ec503631c3d4ed5081e | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 42.877427 | 119 | 0.657864 |
797c4b6d5b712e6b8d68001ddff1f23ae2250ebc | 190 | py | Python | examples/djopenid/consumer/urls.py | pbx/python3-openid | 9123d853268b919012ba9270b5bb1ec83fb89117 | [
"Apache-2.0"
] | 39 | 2015-02-21T13:51:37.000Z | 2022-02-08T10:23:48.000Z | examples/djopenid/consumer/urls.py | pbx/python3-openid | 9123d853268b919012ba9270b5bb1ec83fb89117 | [
"Apache-2.0"
] | 36 | 2015-02-19T20:09:54.000Z | 2021-05-02T13:47:16.000Z | examples/djopenid/consumer/urls.py | pbx/python3-openid | 9123d853268b919012ba9270b5bb1ec83fb89117 | [
"Apache-2.0"
] | 35 | 2015-02-21T13:51:37.000Z | 2021-12-07T17:13:19.000Z | from django.conf.urls.defaults import *
urlpatterns = patterns(
'djopenid.consumer.views',
(r'^$', 'startOpenID'),
(r'^finish/$', 'finishOpenID'),
(r'^xrds/$', 'rpXRDS'), )
| 23.75 | 39 | 0.6 |
797c4c29e6679cdfd63f598688089319d98b1914 | 21,705 | py | Python | backend/app/models.py | dozam8noh8/COMP3900-MealMatch-Website | 3100b923664e9a81bd5b3d7a5fd46c0d7a9c0244 | [
"MIT"
] | null | null | null | backend/app/models.py | dozam8noh8/COMP3900-MealMatch-Website | 3100b923664e9a81bd5b3d7a5fd46c0d7a9c0244 | [
"MIT"
] | null | null | null | backend/app/models.py | dozam8noh8/COMP3900-MealMatch-Website | 3100b923664e9a81bd5b3d7a5fd46c0d7a9c0244 | [
"MIT"
] | null | null | null | from app import db, jwt, time, app, generate_password_hash, check_password_hash, ma
from sqlalchemy import func, desc, event
from app.ErrorException import ErrorException
from sqlalchemy.engine import Engine
import json
from marshmallow import fields
# DB settings
# SQLite doesn't have referential integrity on by defa... | 37.879581 | 131 | 0.635153 |
797c4d53688549bd203956ea5d844f3beb1a7f5d | 551 | py | Python | Module 4/Module_4_problem_6.py | yogendras843/Edureka-Mastering-Python-Assignments | b47e926d753732a8fd697baa60df2d7c2a6c9f02 | [
"MIT"
] | 8 | 2018-04-22T16:17:04.000Z | 2021-08-29T20:09:17.000Z | Module 4/Module_4_problem_6.py | yogendras843/Edureka-Mastering-Python-Assignments | b47e926d753732a8fd697baa60df2d7c2a6c9f02 | [
"MIT"
] | 1 | 2018-10-29T19:59:42.000Z | 2020-08-13T20:21:44.000Z | Module 4/Module_4_problem_6.py | maneeshd/Edureka-Mastering-Python-Assignments | b47e926d753732a8fd697baa60df2d7c2a6c9f02 | [
"MIT"
] | 10 | 2018-02-15T04:54:23.000Z | 2020-09-29T17:15:29.000Z | """
@author: Maneesh D
@date: 29-May-17
@intepreter: Python 3.6
Distance between two points using class.
"""
class Point:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def distance(self, point):
x_part = (self.x - point.x) ** 2
y_part = (self.y - point.y) ** 2
r... | 21.192308 | 86 | 0.566243 |
797c4d9060839e549ed6da6bcfbd10ea632cee28 | 258 | py | Python | activecampaign/emailActivities.py | nhano0228/activecampaign-python | de5f4521a282eb0de4d43ea1c714c5c4a99bfd07 | [
"MIT"
] | null | null | null | activecampaign/emailActivities.py | nhano0228/activecampaign-python | de5f4521a282eb0de4d43ea1c714c5c4a99bfd07 | [
"MIT"
] | null | null | null | activecampaign/emailActivities.py | nhano0228/activecampaign-python | de5f4521a282eb0de4d43ea1c714c5c4a99bfd07 | [
"MIT"
] | null | null | null | class EmailActivities(object):
def __init__(self, client):
self.client = client
def list_all_email_activities(self, **params):
"""
Returns:
"""
return self.client._get("/emailActivities", params=params)
| 21.5 | 66 | 0.600775 |
797c4e48f44cc57143ee7fb221e2c9d3bc8ccfba | 5,859 | py | Python | insights/parsers/nscd_conf.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | 121 | 2017-05-30T20:23:25.000Z | 2022-03-23T12:52:15.000Z | insights/parsers/nscd_conf.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | 1,977 | 2017-05-26T14:36:03.000Z | 2022-03-31T10:38:53.000Z | insights/parsers/nscd_conf.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | 244 | 2017-05-30T20:22:57.000Z | 2022-03-26T10:09:39.000Z | """
NscdConf - file ``/etc/nscd.conf``
==================================
This module parses the contents of the file ``/etc/nscd.conf``.
Each line of the ``nscd.conf`` file specifies either an attribute and a value,
or an attribute, service, and a value. Fields are separated either by SPACE
or TAB characters. A '#'... | 43.080882 | 84 | 0.582864 |
797c4eaf172f37992e991665a47e1d29dee5a7fd | 600 | py | Python | py3/53.py | Triple-Z/LeetCode | e470de54086cdedd4738fe62fe735d89089227dd | [
"MIT"
] | 1 | 2021-05-28T16:46:14.000Z | 2021-05-28T16:46:14.000Z | py3/53.py | Triple-Z/LeetCode | e470de54086cdedd4738fe62fe735d89089227dd | [
"MIT"
] | 12 | 2020-09-17T16:25:24.000Z | 2021-11-16T15:08:44.000Z | py3/53.py | Triple-Z/LeetCode | e470de54086cdedd4738fe62fe735d89089227dd | [
"MIT"
] | 1 | 2021-12-19T07:33:22.000Z | 2021-12-19T07:33:22.000Z | class Solution:
def maxSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
# max_num = nums[0]
# for i in range(1, len(nums)):
# nums[i] = max(nums[i], nums[i-1] + nums[i])
# max_num = max(nums[i], max_num)
... | 26.086957 | 61 | 0.5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.