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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c00644116703b3ee6804116906f03e93406fc56 | 4,673 | py | Python | trees/mcmc.py | islamazhar/trees | 502565c5bf02503c7bece09cddd93f9368da02c3 | [
"MIT"
] | 3 | 2017-01-18T21:20:26.000Z | 2019-01-22T19:11:58.000Z | trees/mcmc.py | islamazhar/trees | 502565c5bf02503c7bece09cddd93f9368da02c3 | [
"MIT"
] | null | null | null | trees/mcmc.py | islamazhar/trees | 502565c5bf02503c7bece09cddd93f9368da02c3 | [
"MIT"
] | 3 | 2016-10-13T06:31:25.000Z | 2021-11-08T19:09:03.000Z | import random
import logging
import numpy as np
class MetropolisHastingsSampler(object):
def __init__(self, tree, X):
self.tree = tree
self.X = X
self.last_move = None
self.likelihoods = []
def initialize_assignments(self):
self.tree.initialize_from_data(self.X)
d... | 35.671756 | 102 | 0.600257 | import random
import logging
import numpy as np
class MetropolisHastingsSampler(object):
def __init__(self, tree, X):
self.tree = tree
self.X = X
self.last_move = None
self.likelihoods = []
def initialize_assignments(self):
self.tree.initialize_from_data(self.X)
d... | true | true |
1c0064d82c6c747041d92559d468f11b71e58df3 | 690 | py | Python | examples/helpers/formatting.py | marjamis/kata-python | fa8b5f31ba9cb7b3838b154ad628d481f5fbb3c0 | [
"Apache-2.0"
] | null | null | null | examples/helpers/formatting.py | marjamis/kata-python | fa8b5f31ba9cb7b3838b154ad628d481f5fbb3c0 | [
"Apache-2.0"
] | 16 | 2021-01-11T11:33:09.000Z | 2022-03-11T01:28:02.000Z | examples/helpers/formatting.py | marjamis/kata-python | fa8b5f31ba9cb7b3838b154ad628d481f5fbb3c0 | [
"Apache-2.0"
] | null | null | null | # TODO convert tests to this class in the future?
class TestRun():
"""A class used for Tests to define what a test and in the future potentially how they're run."""
def __init__(title: str, function_name: str, comment: str):
self.title = title
self.function_name = function_name
self.comment = comment
... | 28.75 | 99 | 0.653623 | class TestRun():
def __init__(title: str, function_name: str, comment: str):
self.title = title
self.function_name = function_name
self.comment = comment
def wrapper(runs):
for i in runs:
print(f"### {i['Title']}")
try:
print(f"Comment: {i['Comment']}")
except KeyError as e:
p... | true | true |
1c0065b06493d03054f3f10fb51d167dd425497a | 5,490 | py | Python | requirements/docutils-0.18/test/test_parsers/test_rst/test_directives/test_admonitions_de.py | QuentinTournier40/AnimationFreeCAD | 8eaff8356ec68b948a721b83a6888b652278db8a | [
"Apache-2.0"
] | null | null | null | requirements/docutils-0.18/test/test_parsers/test_rst/test_directives/test_admonitions_de.py | QuentinTournier40/AnimationFreeCAD | 8eaff8356ec68b948a721b83a6888b652278db8a | [
"Apache-2.0"
] | null | null | null | requirements/docutils-0.18/test/test_parsers/test_rst/test_directives/test_admonitions_de.py | QuentinTournier40/AnimationFreeCAD | 8eaff8356ec68b948a721b83a6888b652278db8a | [
"Apache-2.0"
] | 1 | 2022-02-03T08:03:30.000Z | 2022-02-03T08:03:30.000Z | #! /usr/bin/env python
# $Id: test_admonitions_de.py 8481 2020-01-31 08:17:24Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for admonitions.py directives in German document.
"""
from __future__ import absolute_import
if __name__ == '__m... | 24.508929 | 89 | 0.561384 |
from __future__ import absolute_import
if __name__ == '__main__':
import __init__
from test_parsers import DocutilsTestSupport
def suite():
settings = {'language_code': 'de'}
s = DocutilsTestSupport.ParserTestSuite(suite_settings=settings)
s.generateTests(totest)
return s
totest = {}
totest['a... | true | true |
1c00662623f373a60bbd2126e2d85ce9b58cb80f | 824 | py | Python | djangosaml2/signals.py | brunato/djangosaml2 | 4906bae8ed03ff2a67adec8bf1a1c0a683c10141 | [
"Apache-2.0"
] | 155 | 2016-03-14T14:45:13.000Z | 2021-03-07T21:10:42.000Z | djangosaml2/signals.py | brunato/djangosaml2 | 4906bae8ed03ff2a67adec8bf1a1c0a683c10141 | [
"Apache-2.0"
] | 228 | 2016-03-08T11:52:19.000Z | 2021-03-07T21:34:48.000Z | djangosaml2/signals.py | brunato/djangosaml2 | 4906bae8ed03ff2a67adec8bf1a1c0a683c10141 | [
"Apache-2.0"
] | 118 | 2016-03-08T02:47:28.000Z | 2021-03-05T15:53:51.000Z | # Copyright (C) 2011-2012 Yaco Sistemas (http://www.yaco.es)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 39.238095 | 74 | 0.752427 |
import django.dispatch
pre_user_save = django.dispatch.Signal(
providing_args=['attributes', 'user_modified'])
post_authenticated = django.dispatch.Signal(
providing_args=['session_info', 'request'])
| true | true |
1c0066e38aaf7599570adea9201ac0f60838a726 | 6,668 | py | Python | data/dataset_dncnn.py | NimrodShabtay/KAIR | d744959d75c22b016543dc65c04922ea4b59894f | [
"MIT"
] | null | null | null | data/dataset_dncnn.py | NimrodShabtay/KAIR | d744959d75c22b016543dc65c04922ea4b59894f | [
"MIT"
] | null | null | null | data/dataset_dncnn.py | NimrodShabtay/KAIR | d744959d75c22b016543dc65c04922ea4b59894f | [
"MIT"
] | null | null | null | import os.path
import cv2
import random
import numpy as np
import torch
import torch.utils.data as data
import utils.utils_image as util
from utils.dip_utils import get_noise
class DatasetDnCNN(data.Dataset):
"""
# -----------------------------------------
# Get L/H for denosing on AWGN with fixed sigma.
... | 39.223529 | 109 | 0.435663 | import os.path
import cv2
import random
import numpy as np
import torch
import torch.utils.data as data
import utils.utils_image as util
from utils.dip_utils import get_noise
class DatasetDnCNN(data.Dataset):
def __init__(self, opt):
super(DatasetDnCNN, self).__init__()
print('Dataset: Denosing o... | true | true |
1c00676e362ddd7a83f835b270b28c32e46299b6 | 74,797 | py | Python | lematizer/corpus.py | mobarski/sandbox | 64ac79143750d5dcbd4d0f3abdab6efeb9bdf50c | [
"MIT"
] | null | null | null | lematizer/corpus.py | mobarski/sandbox | 64ac79143750d5dcbd4d0f3abdab6efeb9bdf50c | [
"MIT"
] | null | null | null | lematizer/corpus.py | mobarski/sandbox | 64ac79143750d5dcbd4d0f3abdab6efeb9bdf50c | [
"MIT"
] | null | null | null | # encoding: utf8
text1 = u"""
Sąd zdecydował dzisiaj o areszcie dla podejrzanego o zabójstwo 28-latka w Siemianowicach Śląskich. Zdecydował zaocznie - bo podejrzany nie został jeszcze zatrzymany. Ale decyzja sądu to ułatwi. Otwiera bowiem drogę do wydania listu gończego za poszukiwanym i opublikowania jego wizerunku. ... | 217.43314 | 3,542 | 0.826183 | text1 = u"""
Sąd zdecydował dzisiaj o areszcie dla podejrzanego o zabójstwo 28-latka w Siemianowicach Śląskich. Zdecydował zaocznie - bo podejrzany nie został jeszcze zatrzymany. Ale decyzja sądu to ułatwi. Otwiera bowiem drogę do wydania listu gończego za poszukiwanym i opublikowania jego wizerunku. Sąd Rejonowy w Si... | true | true |
1c0068e1f7a1380fea7e28cffbc1bc8a0dab6e4b | 7,025 | py | Python | old_scripts/enrich_pilot_data.py | sfschouten/multilingual-wiki-event-pipeline | b52243b23f7f383555399cfbefb2c345ba48414b | [
"Apache-2.0"
] | 4 | 2019-05-21T05:28:55.000Z | 2021-05-31T05:58:53.000Z | old_scripts/enrich_pilot_data.py | sfschouten/multilingual-wiki-event-pipeline | b52243b23f7f383555399cfbefb2c345ba48414b | [
"Apache-2.0"
] | 1 | 2021-03-31T19:07:32.000Z | 2021-03-31T19:07:32.000Z | old_scripts/enrich_pilot_data.py | sfschouten/multilingual-wiki-event-pipeline | b52243b23f7f383555399cfbefb2c345ba48414b | [
"Apache-2.0"
] | 3 | 2019-08-22T07:42:09.000Z | 2022-02-09T21:13:18.000Z | import spacy
import sys
from collections import namedtuple, Counter
import pickle
import shutil
from pathlib import Path
import os.path
import spacy_to_naf
import xml.etree.ElementTree as ET
from lxml import etree
from datetime import datetime
import wikitextparser as wtp
import xml_utils
EntityElement = namedtuple('E... | 36.780105 | 103 | 0.585907 | import spacy
import sys
from collections import namedtuple, Counter
import pickle
import shutil
from pathlib import Path
import os.path
import spacy_to_naf
import xml.etree.ElementTree as ET
from lxml import etree
from datetime import datetime
import wikitextparser as wtp
import xml_utils
EntityElement = namedtuple('E... | true | true |
1c006917b311f7a8e606559d0f0eced2f4cc5c3a | 2,509 | py | Python | harmonic_processor.py | eschwarz301/Audacity-Harmonic-Processor | 0b5a927e5ba48e56aeb7ef00cdc5ada2b526c143 | [
"MIT"
] | null | null | null | harmonic_processor.py | eschwarz301/Audacity-Harmonic-Processor | 0b5a927e5ba48e56aeb7ef00cdc5ada2b526c143 | [
"MIT"
] | null | null | null | harmonic_processor.py | eschwarz301/Audacity-Harmonic-Processor | 0b5a927e5ba48e56aeb7ef00cdc5ada2b526c143 | [
"MIT"
] | null | null | null | __author__ = 'eschwarz'
'''
Creates an .xml file containing information for an equalization curve capable of isolating a user defined frequency and its
harmonics. The output file can be imported to Audacity with the "Save/Manage Curves" option under Effect/Equalization in the Audacity toolbar.
'''
import xml.etree.Elem... | 44.803571 | 142 | 0.618573 | __author__ = 'eschwarz'
import xml.etree.ElementTree as ET
class IsolateHarmonic(object):
def __init__(self):
self.eq_name = ''
self.frequency = 0.0
self.harmonics = 0
self.reduction = 0.0
def user_input(self):
self.eq_name = input('Name this Equalizer: ')
self... | true | true |
1c00694e358124ca4fce6150a7757529b517f4e1 | 1,283 | py | Python | scripts/plot_residual_norm.py | maierbn/opendihu | 577650e2f6b36a7306766b0f4176f8124458cbf0 | [
"MIT"
] | 17 | 2018-11-25T19:29:34.000Z | 2021-09-20T04:46:22.000Z | scripts/plot_residual_norm.py | maierbn/opendihu | 577650e2f6b36a7306766b0f4176f8124458cbf0 | [
"MIT"
] | 1 | 2020-11-12T15:15:58.000Z | 2020-12-29T15:29:24.000Z | scripts/plot_residual_norm.py | maierbn/opendihu | 577650e2f6b36a7306766b0f4176f8124458cbf0 | [
"MIT"
] | 4 | 2018-10-17T12:18:10.000Z | 2021-05-28T13:24:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Script to plot residual norm which is stored in a file.
# Such a file will be created by the nonlinear solver if the "logfile": "filename" option is set.
# The file contains lines "index;number", e.g. 0:2.5698
#
# Arguments: [<residual norm text file>]
#
import sys, o... | 19.738462 | 97 | 0.651598 |
import sys, os
import matplotlib.pyplot as plt
filenames = ["log_residual_norm.txt"]
if len(sys.argv) > 1:
filenames = sys.argv[1:]
print filenames
fig = plt.figure()
for filename in filenames:
try:
logfile = open(filename, "r")
except:
print("Could not open file \"{}\"".format(filename))
con... | false | true |
1c006ba7eabed7f74ce67ab6c617c3af808a315d | 1,647 | py | Python | Product/models.py | Jinr0h404/projet10 | 8d344c6257a7f9436d2ead0a7c12a4da05991fc1 | [
"OML"
] | null | null | null | Product/models.py | Jinr0h404/projet10 | 8d344c6257a7f9436d2ead0a7c12a4da05991fc1 | [
"OML"
] | null | null | null | Product/models.py | Jinr0h404/projet10 | 8d344c6257a7f9436d2ead0a7c12a4da05991fc1 | [
"OML"
] | null | null | null | from django.db import models
# Create your models here.
class Category(models.Model):
"""this class is for the django orm, it gives the parameters for the
creation of the table of the same name in the psql database."""
category_name = models.CharField(
max_length=200, unique=True, verbose_name="Ca... | 37.431818 | 86 | 0.713418 | from django.db import models
class Category(models.Model):
category_name = models.CharField(
max_length=200, unique=True, verbose_name="Catégorie"
)
def __str__(self):
return f"{self.category_name}"
class Store(models.Model):
store_name = models.CharField(max_length=100, unique=True... | true | true |
1c006c92b1246346917d3232250c09f5b45271cd | 8,753 | py | Python | docs/source/conf.py | echevemaster/fedora-college | 55033de5dd6f3a1063bf12f0b8937b493ae07692 | [
"BSD-3-Clause"
] | 4 | 2015-05-16T09:54:18.000Z | 2016-01-08T16:52:19.000Z | docs/source/conf.py | fedora-infra/fedora-college | cf310dab2e4fea02b9ac5e7f57dc53aafb4834d8 | [
"BSD-3-Clause"
] | 1 | 2015-12-03T21:30:13.000Z | 2016-01-09T10:47:24.000Z | docs/source/conf.py | echevemaster/fedora-college | 55033de5dd6f3a1063bf12f0b8937b493ae07692 | [
"BSD-3-Clause"
] | 1 | 2019-06-30T15:51:52.000Z | 2019-06-30T15:51:52.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
# This file is based upon the file generated by sphinx-quickstart. However,
# where sphinx-quickstart hardcodes values in this file that you input, this
# file has been changed to pull from your module's metadata module.
#
# This file is execfile(... | 32.180147 | 79 | 0.719296 |
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
import sys
# If extensio... | true | true |
1c006edfb71594e10764888d2fcacfd530cad020 | 444 | py | Python | potd_ii/potd_ii/settings/test.py | qubitstream/picture_of_the_day_aggregation_site_2 | 675a354a84b8f3184cfa2c7568637be886939704 | [
"CNRI-Python"
] | null | null | null | potd_ii/potd_ii/settings/test.py | qubitstream/picture_of_the_day_aggregation_site_2 | 675a354a84b8f3184cfa2c7568637be886939704 | [
"CNRI-Python"
] | null | null | null | potd_ii/potd_ii/settings/test.py | qubitstream/picture_of_the_day_aggregation_site_2 | 675a354a84b8f3184cfa2c7568637be886939704 | [
"CNRI-Python"
] | null | null | null | from .base import *
ACTIVE_SETTING = 'test'
TEST_RUNNER = 'discover_runner.DiscoverRunner'
TEST_DISCOVER_TOP_LEVEL = BASE_DIR
TEST_DISCOVER_ROOT = BASE_DIR
TEST_DISCOVER_PATTERN = 'test_*'
########## IN-MEMORY TEST DATABASE
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memo... | 18.5 | 46 | 0.594595 | from .base import *
ACTIVE_SETTING = 'test'
TEST_RUNNER = 'discover_runner.DiscoverRunner'
TEST_DISCOVER_TOP_LEVEL = BASE_DIR
TEST_DISCOVER_ROOT = BASE_DIR
TEST_DISCOVER_PATTERN = 'test_*'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
'PASSWORD... | true | true |
1c006eec3ca2841276bc58fd6e4bbb5fc89e9a48 | 1,871 | py | Python | PyQt5/Section 1/comboboxes.py | Advik-B/Learn-Python | 66ac57259764e8f2c3c6513a8de6c106800d8abe | [
"MIT"
] | 6 | 2021-07-26T14:21:25.000Z | 2021-07-26T14:32:01.000Z | PyQt5/Section 1/comboboxes.py | Advik-B/Learn-Python | 66ac57259764e8f2c3c6513a8de6c106800d8abe | [
"MIT"
] | 2 | 2021-12-10T10:25:19.000Z | 2021-12-10T10:27:15.000Z | PyQt5/Section 1/comboboxes.py | Advik-B/Learn-Python | 66ac57259764e8f2c3c6513a8de6c106800d8abe | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import QApplication, QComboBox, QWidget, QPushButton
from sys import argv, exit as sys_exit
class Window(QWidget):
def __init__(self):
super().__init__()
self.init_ui()
def init_ui(self):
self.setGeometry(900, 150, 600, 700)
self.setWindowTitle('ComboBoxes'... | 25.986111 | 73 | 0.394976 | from PyQt5.QtWidgets import QApplication, QComboBox, QWidget, QPushButton
from sys import argv, exit as sys_exit
class Window(QWidget):
def __init__(self):
super().__init__()
self.init_ui()
def init_ui(self):
self.setGeometry(900, 150, 600, 700)
self.setWindowTitle('ComboBoxes'... | true | true |
1c006ef4600389f838dd44c72e6950831aa2bac1 | 1,830 | py | Python | typewise_alert.py | clean-code-craft-tcq-2/coverage-in-py-SomeduttaSahoo | 35a6ba2dea3c8d1be96a9527dba21c452349fe4a | [
"MIT"
] | null | null | null | typewise_alert.py | clean-code-craft-tcq-2/coverage-in-py-SomeduttaSahoo | 35a6ba2dea3c8d1be96a9527dba21c452349fe4a | [
"MIT"
] | null | null | null | typewise_alert.py | clean-code-craft-tcq-2/coverage-in-py-SomeduttaSahoo | 35a6ba2dea3c8d1be96a9527dba21c452349fe4a | [
"MIT"
] | null | null | null | def infer_breach(value, lowerLimit, upperLimit):
if value < lowerLimit:
return 'TOO_LOW'
if value > upperLimit:
return 'TOO_HIGH'
return 'NORMAL'
def coolingtype_range(coolingType):
coolingType_dict={'PASSIVE_COOLING':{"lowerLimit":0,"upperLimit":35},'HI_ACTIVE_COOLING':{"lowerLimit":0,"... | 33.888889 | 186 | 0.714754 | def infer_breach(value, lowerLimit, upperLimit):
if value < lowerLimit:
return 'TOO_LOW'
if value > upperLimit:
return 'TOO_HIGH'
return 'NORMAL'
def coolingtype_range(coolingType):
coolingType_dict={'PASSIVE_COOLING':{"lowerLimit":0,"upperLimit":35},'HI_ACTIVE_COOLING':{"lowerLimit":0,"... | true | true |
1c006fa66bc3aeb8d2d3b3bd84ce0d4a290454e1 | 3,996 | py | Python | tests/test_functional.py | demosdemon/dude-wheres-my-car | c4db13dd8f2ec7439a37bdef096c8adeb3e54553 | [
"MIT"
] | null | null | null | tests/test_functional.py | demosdemon/dude-wheres-my-car | c4db13dd8f2ec7439a37bdef096c8adeb3e54553 | [
"MIT"
] | 2 | 2018-08-30T01:35:29.000Z | 2018-09-01T02:08:15.000Z | tests/test_functional.py | demosdemon/dude-wheres-my-car | c4db13dd8f2ec7439a37bdef096c8adeb3e54553 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
from flask import url_for
from dude.user.models import User
from .factories import UserFactory
class TestLoggingIn:
"""Login."""
def test_can_log_in_returns_200(self, user, testapp):
"""Login succes... | 33.024793 | 80 | 0.588839 | from flask import url_for
from dude.user.models import User
from .factories import UserFactory
class TestLoggingIn:
def test_can_log_in_returns_200(self, user, testapp):
res = testapp.get('/')
form = res.forms['loginForm']
form['username'] = user.username
form['p... | true | true |
1c00713a381179f1746325d5656cc00a3c5bf2fd | 12,913 | py | Python | Initialization/initialization.py | ekunnii/APPIAN | 6bfeb5ffa04ca893c9ea22f04dbbb212798caeb1 | [
"MIT"
] | 1 | 2021-04-15T01:46:36.000Z | 2021-04-15T01:46:36.000Z | Initialization/initialization.py | gkiar/APPIAN | 1460ef4e1b5c98a558b7f89753f1a1a5541374cf | [
"MIT"
] | null | null | null | Initialization/initialization.py | gkiar/APPIAN | 1460ef4e1b5c98a558b7f89753f1a1a5541374cf | [
"MIT"
] | null | null | null | import os
import numpy as np
import tempfile
import shutil
import json
import ntpath
import shutil
import nibabel as nib
import re
import nipype.pipeline.engine as pe
import nipype.interfaces.utility as niu
from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath,
BaseInterface, OutputMulti... | 38.204142 | 223 | 0.645319 | import os
import numpy as np
import tempfile
import shutil
import json
import ntpath
import shutil
import nibabel as nib
import re
import nipype.pipeline.engine as pe
import nipype.interfaces.utility as niu
from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath,
BaseInterface, OutputMulti... | true | true |
1c007141d7ce66199d63f2ea91f6f1df892dfaa4 | 267 | py | Python | primes.py | arichardson/cpython | 63f156e0e6880dbfed4be3193956b9190aeb32a3 | [
"PSF-2.0"
] | null | null | null | primes.py | arichardson/cpython | 63f156e0e6880dbfed4be3193956b9190aeb32a3 | [
"PSF-2.0"
] | null | null | null | primes.py | arichardson/cpython | 63f156e0e6880dbfed4be3193956b9190aeb32a3 | [
"PSF-2.0"
] | null | null | null | def get_primes(n):
numbers = set(range(n, 1, -1))
primes = []
while numbers:
p = numbers.pop()
primes.append(p)
numbers.difference_update(set(range(p * 2, n + 1, p)))
return primes
primes = get_primes(100000)
print("last prime:", primes[len(primes) - 1])
| 20.538462 | 56 | 0.655431 | def get_primes(n):
numbers = set(range(n, 1, -1))
primes = []
while numbers:
p = numbers.pop()
primes.append(p)
numbers.difference_update(set(range(p * 2, n + 1, p)))
return primes
primes = get_primes(100000)
print("last prime:", primes[len(primes) - 1])
| true | true |
1c0071443d8374ee96866af3c120f82363ad3486 | 40,066 | py | Python | frappe/__init__.py | lukptr/frappe-v7.2.23 | 494f39de78ad9f3ea7b3ff1239a34df35e6f3727 | [
"MIT"
] | null | null | null | frappe/__init__.py | lukptr/frappe-v7.2.23 | 494f39de78ad9f3ea7b3ff1239a34df35e6f3727 | [
"MIT"
] | null | null | null | frappe/__init__.py | lukptr/frappe-v7.2.23 | 494f39de78ad9f3ea7b3ff1239a34df35e6f3727 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""
globals attached to frappe module
+ some utility functions that should probably be moved
"""
from __future__ import unicode_literals
from werkzeug.local import Local, release_local
import os, sys, importlib, inspect... | 31.25273 | 180 | 0.728648 | """
globals attached to frappe module
+ some utility functions that should probably be moved
"""
from __future__ import unicode_literals
from werkzeug.local import Local, release_local
import os, sys, importlib, inspect, json
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template
... | false | true |
1c0071a5a62496fcdcbaf708c48ee0819be5bcb9 | 4,171 | py | Python | comment/service/email.py | Italo-Carvalho/Comment | 86424d02a901b74ccbcaa438fffc38f352535301 | [
"MIT"
] | 75 | 2018-09-08T14:29:35.000Z | 2022-03-25T16:17:06.000Z | comment/service/email.py | p0-oya/Comment | 39f6fb6c40314d97391d36fc25112d6420c96991 | [
"MIT"
] | 165 | 2018-10-07T21:55:31.000Z | 2022-02-27T14:44:32.000Z | comment/service/email.py | p0-oya/Comment | 39f6fb6c40314d97391d36fc25112d6420c96991 | [
"MIT"
] | 37 | 2019-12-01T19:44:23.000Z | 2022-02-13T16:46:14.000Z | from threading import Thread
from django.contrib.sites.shortcuts import get_current_site
from django.core import signing
from django.core.mail import EmailMultiAlternatives, get_connection
from django.template import loader
from django.urls import reverse
from comment.conf import settings
from comment.messages import... | 42.561224 | 102 | 0.71182 | from threading import Thread
from django.contrib.sites.shortcuts import get_current_site
from django.core import signing
from django.core.mail import EmailMultiAlternatives, get_connection
from django.template import loader
from django.urls import reverse
from comment.conf import settings
from comment.messages import... | true | true |
1c0072c5183307f4993fd2ae4e679fe13e7f3b22 | 3,491 | py | Python | keepmo/notes/views.py | YunusEmreUyar/Django-Notes-App | 2fbe40403e7a97ba7ac9dffd64c77073758876e8 | [
"MIT"
] | null | null | null | keepmo/notes/views.py | YunusEmreUyar/Django-Notes-App | 2fbe40403e7a97ba7ac9dffd64c77073758876e8 | [
"MIT"
] | null | null | null | keepmo/notes/views.py | YunusEmreUyar/Django-Notes-App | 2fbe40403e7a97ba7ac9dffd64c77073758876e8 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404, get_list_or_404
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.http import HttpResponseRedirect
from .models import NoteBook, Note, Profile
from .forms import NoteBookForm, NoteForm, NewUserForm, Edi... | 36.364583 | 91 | 0.753079 | from django.shortcuts import render, redirect, get_object_or_404, get_list_or_404
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.http import HttpResponseRedirect
from .models import NoteBook, Note, Profile
from .forms import NoteBookForm, NoteForm, NewUserForm, Edi... | true | true |
1c0072d2b3faf876aff63d113d11c4f7fcee7458 | 31 | py | Python | lbry/constants.py | nishp77/lbry-sdk | 7531401623a393a1491e3b65de0e2a65f8e45020 | [
"MIT"
] | 4,996 | 2019-06-21T04:44:34.000Z | 2022-03-31T14:24:52.000Z | lbry/constants.py | nishp77/lbry-sdk | 7531401623a393a1491e3b65de0e2a65f8e45020 | [
"MIT"
] | 1,934 | 2015-11-25T20:40:45.000Z | 2019-06-21T00:50:03.000Z | lbry/constants.py | nishp77/lbry-sdk | 7531401623a393a1491e3b65de0e2a65f8e45020 | [
"MIT"
] | 369 | 2015-12-05T21:18:07.000Z | 2019-06-10T12:40:50.000Z | CENT = 1000000
COIN = 100*CENT
| 10.333333 | 15 | 0.709677 | CENT = 1000000
COIN = 100*CENT
| true | true |
1c0075fc1bacf4e0da04c7f68a75edcbd4fad13e | 3,050 | py | Python | laygo/generators/adc_sar/tisaradc_top_fullstack_generator.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 26 | 2017-07-07T08:06:31.000Z | 2021-11-25T06:41:24.000Z | laygo/generators/adc_sar/tisaradc_top_fullstack_generator.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 9 | 2016-12-28T03:08:29.000Z | 2019-01-30T16:00:28.000Z | laygo/generators/adc_sar/tisaradc_top_fullstack_generator.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 10 | 2018-07-14T01:31:28.000Z | 2021-08-21T10:18:30.000Z | def execfile(filepath, globals=None, locals=None):
if globals is None:
globals = {}
globals.update({
"__file__": filepath,
"__name__": "__main__",
})
import os
with open(filepath, 'rb') as file:
exec(compile(file.read(), filepath, 'exec'), globals, locals)
files=[
... | 55.454545 | 90 | 0.798689 | def execfile(filepath, globals=None, locals=None):
if globals is None:
globals = {}
globals.update({
"__file__": filepath,
"__name__": "__main__",
})
import os
with open(filepath, 'rb') as file:
exec(compile(file.read(), filepath, 'exec'), globals, locals)
files=[
... | true | true |
1c00763088f4e0b0ee913fe982043ab32a41e4d6 | 50 | py | Python | Prog/name.py | dipivan/my-first-blog | 07c2b7ba631c747ac85bbd32fcedb9305474b7b8 | [
"bzip2-1.0.6"
] | null | null | null | Prog/name.py | dipivan/my-first-blog | 07c2b7ba631c747ac85bbd32fcedb9305474b7b8 | [
"bzip2-1.0.6"
] | null | null | null | Prog/name.py | dipivan/my-first-blog | 07c2b7ba631c747ac85bbd32fcedb9305474b7b8 | [
"bzip2-1.0.6"
] | null | null | null | name=input("Як вас звати?")
print("Привіт,",name)
| 16.666667 | 27 | 0.68 | name=input("Як вас звати?")
print("Привіт,",name)
| true | true |
1c0078016b9d32ed454a4a1a37d5e2a2c75e0d93 | 4,337 | py | Python | dotfiles/private_dot_i3/executable_wrapper.py | marvinpinto/kitchensink | c4ee0394f7074b9408fbaad9309816b6e688adb6 | [
"MIT"
] | 7 | 2016-02-22T15:29:04.000Z | 2021-11-07T22:57:25.000Z | roles/i3/files/wrapper.py | marvinpinto/laptop | 35895399a943e150847817bb3d2fad333b068727 | [
"MIT"
] | 12 | 2016-02-15T21:04:08.000Z | 2022-03-15T04:09:04.000Z | dotfiles/private_dot_i3/executable_wrapper.py | marvinpinto/kitchensink | c4ee0394f7074b9408fbaad9309816b6e688adb6 | [
"MIT"
] | 4 | 2016-02-15T20:14:03.000Z | 2021-11-15T01:21:30.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script is a simple wrapper which prefixes each i3status line with custom
# information. It is a python reimplementation of:
# http://code.stapelberg.de/git/i3status/tree/contrib/wrapper.pl
#
# To use it, ensure your ~/.i3status.conf contains this line:
# output_... | 29.705479 | 109 | 0.656675 |
import sys
import json
import os
import time
from datetime import datetime
from subprocess import check_output
TWO_HOURS = 60*60*2 TWO_DAYS = 172800 SEVEN_DAYS = 604800 COLORS = {
'GOOD': '#00FF00',
'DEGRADED': '#FFFF00',
'BAD': '#FF0000'
}
backup_status_file = "%s/tmp/backup-timestamp.txt" % os.environ['H... | true | true |
1c00781a16c957e84e42d292e9e29e6c2fc1c463 | 5,118 | py | Python | container-context-manager.py | omkarkhatavkar/content-host-helpers | d15f8b54dae7b0b89bd5527674a75b74d2274ac1 | [
"MIT"
] | null | null | null | container-context-manager.py | omkarkhatavkar/content-host-helpers | d15f8b54dae7b0b89bd5527674a75b74d2274ac1 | [
"MIT"
] | null | null | null | container-context-manager.py | omkarkhatavkar/content-host-helpers | d15f8b54dae7b0b89bd5527674a75b74d2274ac1 | [
"MIT"
] | null | null | null | import docker
import random
from uuid import uuid4
class DockerContainer:
def __init__(self, image, tag, agent=False, ports=None):
"""Gather information needed to spin up a Docker-based container."""
import docker.api.container
self._client = docker.Client(version="1.22")
self.ima... | 33.45098 | 134 | 0.567214 | import docker
import random
from uuid import uuid4
class DockerContainer:
def __init__(self, image, tag, agent=False, ports=None):
import docker.api.container
self._client = docker.Client(version="1.22")
self.image = image
self.tag = tag
self.name = uuid4()
self.po... | true | true |
1c007828f75c2c6e3a0b5baba02be5c70282adfa | 858 | py | Python | GuizeroProp/PyTeletextProp/constants.py | xcape-io/PyProps | 38502c8d083fde1ab03d5f83f505424138177561 | [
"MIT"
] | 1 | 2021-06-27T15:10:42.000Z | 2021-06-27T15:10:42.000Z | GuizeroProp/PyTeletextProp/constants.py | xcape-io/PyProps | 38502c8d083fde1ab03d5f83f505424138177561 | [
"MIT"
] | null | null | null | GuizeroProp/PyTeletextProp/constants.py | xcape-io/PyProps | 38502c8d083fde1ab03d5f83f505424138177561 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
constants.py
Contains all the application constants. As a rule all constants are named in all caps.
"""
APPLICATION = "Teletext"
PYPROPS_CORELIBPATH = '../../core'
PUBLISHALLDATA_PERIOD = 30.0
USE_GPIO = True
#_____________________________________________________... | 23.189189 | 86 | 0.805361 |
APPLICATION = "Teletext"
PYPROPS_CORELIBPATH = '../../core'
PUBLISHALLDATA_PERIOD = 30.0
USE_GPIO = True
CONFIG_FILE = '.config.yml'
MQTT_DEFAULT_HOST = 'localhost'
MQTT_DEFAULT_PORT = 1883
MQTT_DEFAULT_QoS = 1
MQTT_KEEPALIVE = 15
WINDOW_TITLE = "Teletext"
GPIO_RELAY_LIGHT = 16
MQTT_DISPLAY_TOPIC = 'Room/My r... | true | true |
1c0078c610bb5f1d5b040103b1fd2a7b2c93680d | 872 | py | Python | StarCTF/2018/warmup/exploit.py | Per5ianCat/ctf-writeups | 1fd27f5d9619bddf670f25343948a8fe2f005f63 | [
"MIT"
] | 476 | 2019-10-23T10:53:18.000Z | 2021-03-30T10:54:19.000Z | StarCTF/2018/warmup/exploit.py | lqhuyapcs/PersianCatsCTF | de26220cb0af73eb79d9d829c5a4b72f61aac5d2 | [
"MIT"
] | 9 | 2020-03-29T07:33:39.000Z | 2021-03-20T09:50:56.000Z | StarCTF/2018/warmup/exploit.py | lqhuyapcs/PersianCatsCTF | de26220cb0af73eb79d9d829c5a4b72f61aac5d2 | [
"MIT"
] | 61 | 2019-11-11T08:39:16.000Z | 2021-03-27T16:49:16.000Z | #!/usr/bin/env python
from pwn import *
def leak(addr):
p.sendline(str(addr))
p.recvuntil('for?\n')
return int(p.recvuntil('name?').strip().split()[0], 16)
with context.quiet:
p = process('./program')
'''
0x4526a execve("/bin/sh", rsp+0x30, environ)
constraints:
[rsp+0x30] == NUL... | 21.268293 | 117 | 0.611239 |
from pwn import *
def leak(addr):
p.sendline(str(addr))
p.recvuntil('for?\n')
return int(p.recvuntil('name?').strip().split()[0], 16)
with context.quiet:
p = process('./program')
'''
0x4526a execve("/bin/sh", rsp+0x30, environ)
constraints:
[rsp+0x30] == NULL
'''
write_o... | false | true |
1c00794dc3747db1406055f72accb63a790e7dec | 2,354 | py | Python | www/blog/migrations/0001_initial.py | zsoobhan/prometheus | a255740a9b171ecbb7c5b96c7007830c9e9c7a4b | [
"MIT"
] | 3 | 2015-02-22T23:55:00.000Z | 2020-01-14T05:07:52.000Z | www/blog/migrations/0001_initial.py | zsoobhan/prometheus | a255740a9b171ecbb7c5b96c7007830c9e9c7a4b | [
"MIT"
] | 15 | 2015-03-26T17:58:11.000Z | 2022-01-13T00:40:08.000Z | www/blog/migrations/0001_initial.py | zsoobhan/prometheus | a255740a9b171ecbb7c5b96c7007830c9e9c7a4b | [
"MIT"
] | 2 | 2019-08-28T19:43:16.000Z | 2020-01-14T05:07:54.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import ckeditor.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='BlogEntry',
fields=[
('i... | 42.035714 | 188 | 0.56712 | from __future__ import unicode_literals
from django.db import models, migrations
import ckeditor.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='BlogEntry',
fields=[
('id', models.AutoField(ver... | true | true |
1c007a2b6fc8d402b26213c135aff3d72dc71e68 | 59,708 | py | Python | Lib/test/test_pdb.py | CerfVert94/cpython | 7f1807bf9c4239ef26522c7737ab8f38db3b41be | [
"0BSD"
] | null | null | null | Lib/test/test_pdb.py | CerfVert94/cpython | 7f1807bf9c4239ef26522c7737ab8f38db3b41be | [
"0BSD"
] | 1 | 2022-01-06T16:51:46.000Z | 2022-01-06T16:51:46.000Z | Lib/test/test_pdb.py | docmarionum1/pyvcs-python | f62cf1a76d51302f342319d446d6fbf3c60f29c3 | [
"0BSD"
] | 1 | 2022-02-25T21:54:28.000Z | 2022-02-25T21:54:28.000Z | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import codecs
import unittest
import subprocess
import textwrap
import linecache
from contextlib import ExitStack
from io import StringIO
from test import support
# This little helper class is ess... | 32.239741 | 121 | 0.557563 |
import doctest
import os
import pdb
import sys
import types
import codecs
import unittest
import subprocess
import textwrap
import linecache
from contextlib import ExitStack
from io import StringIO
from test import support
from test.test_doctest import _FakeInput
from unittest.mock import patch
from bdb import Break... | true | true |
1c007abd32d4512fd6480cd589ae520c54d97db4 | 14,284 | py | Python | cbmcodecs/petscii_vic20en_uc.py | fatman2021/project-manhattan | a24febefcdd63923c6ba7da78e4d9db95157c4bf | [
"Apache-2.0"
] | 2 | 2020-01-08T06:18:56.000Z | 2021-07-24T03:05:10.000Z | cbmcodecs/petscii_vic20en_uc.py | fatman2021/project-manhattan | a24febefcdd63923c6ba7da78e4d9db95157c4bf | [
"Apache-2.0"
] | null | null | null | cbmcodecs/petscii_vic20en_uc.py | fatman2021/project-manhattan | a24febefcdd63923c6ba7da78e4d9db95157c4bf | [
"Apache-2.0"
] | 1 | 2021-07-24T03:05:11.000Z | 2021-07-24T03:05:11.000Z | """ Python Character Mapping Codec petscii_vic20en_uc generated from 'mappings/petscii_vic20en_uc.txt' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return codecs.charmap_encode(input, errors, encoding_table)
def decode(se... | 46.226537 | 120 | 0.554467 |
import codecs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return codecs.charmap_encode(input, errors, encoding_table)
def decode(self, input, errors='strict'):
return codecs.charmap_decode(input, errors, decoding_table)
class IncrementalEncoder(codecs.IncrementalEn... | true | true |
1c007b6d1ac76d60cf0e743019396b9a36674de4 | 754 | py | Python | src/shut/templates/pylintrc.py | NiklasRosenstein/shut | 517bded2ff54306257d5622a08a1ba1ec967ffe5 | [
"MIT"
] | 5 | 2020-11-30T04:06:27.000Z | 2022-01-06T17:14:33.000Z | src/shut/templates/pylintrc.py | NiklasRosenstein/shut | 517bded2ff54306257d5622a08a1ba1ec967ffe5 | [
"MIT"
] | 33 | 2020-09-07T16:58:14.000Z | 2022-02-13T00:59:28.000Z | src/shut/templates/pylintrc.py | NiklasRosenstein/shut | 517bded2ff54306257d5622a08a1ba1ec967ffe5 | [
"MIT"
] | 2 | 2020-12-12T10:02:12.000Z | 2021-06-06T05:41:12.000Z |
import dataclasses
from shut.data import load_string
from shut.model import AbstractProjectModel, PackageModel
from shut.renderers import Renderer
from shut.utils.io.virtual import VirtualFiles
@dataclasses.dataclass
class PylintRcTemplate(Renderer[AbstractProjectModel]):
#: The name of the pylintrc template to u... | 34.272727 | 84 | 0.77321 |
import dataclasses
from shut.data import load_string
from shut.model import AbstractProjectModel, PackageModel
from shut.renderers import Renderer
from shut.utils.io.virtual import VirtualFiles
@dataclasses.dataclass
class PylintRcTemplate(Renderer[AbstractProjectModel]):
use: str
output: str = '.pylintrc'... | true | true |
1c007b9151cdcaf309ca7b7967025963cc0f1778 | 19,365 | py | Python | examples/utils_multiple_choice.py | AdityaGovardhan/transformers | 51dd3dc33853c36a071eb141b84da7b519b44d4d | [
"Apache-2.0"
] | null | null | null | examples/utils_multiple_choice.py | AdityaGovardhan/transformers | 51dd3dc33853c36a071eb141b84da7b519b44d4d | [
"Apache-2.0"
] | null | null | null | examples/utils_multiple_choice.py | AdityaGovardhan/transformers | 51dd3dc33853c36a071eb141b84da7b519b44d4d | [
"Apache-2.0"
] | 1 | 2020-04-20T03:20:22.000Z | 2020-04-20T03:20:22.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 39.359756 | 140 | 0.587658 |
import csv
import glob
import json
import logging
import os
from typing import List
import tqdm
from transformers import PreTrainedTokenizer
from text_rank_reduction import Reduction
from eazymind.nlp.eazysum import Summarizer
logger = logging.getLogger(__name__)
class InputExample(object):
def __init__(se... | true | true |
1c007c6398ff1e6a2b0c61c601cb953dc6c98afd | 1,620 | py | Python | experiments/karla/diplomski-rad/blade/pb/datasets/n15-all-indels/experiments-queue/model-n15-all-indel-14.py | lvrcek/consensus-net | 560957f315751822e1ddf8c097eb7b712ceadff3 | [
"MIT"
] | null | null | null | experiments/karla/diplomski-rad/blade/pb/datasets/n15-all-indels/experiments-queue/model-n15-all-indel-14.py | lvrcek/consensus-net | 560957f315751822e1ddf8c097eb7b712ceadff3 | [
"MIT"
] | null | null | null | experiments/karla/diplomski-rad/blade/pb/datasets/n15-all-indels/experiments-queue/model-n15-all-indel-14.py | lvrcek/consensus-net | 560957f315751822e1ddf8c097eb7b712ceadff3 | [
"MIT"
] | 1 | 2018-12-23T13:50:29.000Z | 2018-12-23T13:50:29.000Z | from comet_ml import Experiment
experiment = Experiment(api_key="oda8KKpxlDgWmJG5KsYrrhmIV", project_name="consensusnet")
import numpy as np
from keras.models import Model
from keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalization, Input
from keras.layers import Conv1D, MaxPooling1D, Conv2D, Max... | 37.674419 | 128 | 0.753086 | from comet_ml import Experiment
experiment = Experiment(api_key="oda8KKpxlDgWmJG5KsYrrhmIV", project_name="consensusnet")
import numpy as np
from keras.models import Model
from keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalization, Input
from keras.layers import Conv1D, MaxPooling1D, Conv2D, Max... | true | true |
1c007c9a2dd469444856c1d234f1322e7a68b4e3 | 3,039 | py | Python | docusign_esign/models/supported_languages.py | hunk/docusign-python-client | a643c42c1236715e74eef6fc279a1b29da1b5455 | [
"MIT"
] | null | null | null | docusign_esign/models/supported_languages.py | hunk/docusign-python-client | a643c42c1236715e74eef6fc279a1b29da1b5455 | [
"MIT"
] | null | null | null | docusign_esign/models/supported_languages.py | hunk/docusign-python-client | a643c42c1236715e74eef6fc279a1b29da1b5455 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from p... | 26.426087 | 126 | 0.546561 |
from pprint import pformat
from six import iteritems
import re
class SupportedLanguages(object):
def __init__(self, languages=None):
self.swagger_types = {
'languages': 'list[NameValue]'
}
self.attribute_map = {
'languages': 'languages'
}
self._... | true | true |
1c007d9675cd25da18c112748c36e1a72911db38 | 1,773 | py | Python | tools/pnnx/tests/ncnn/test_F_hardtanh.py | CeasarLee/ncnn | 178825d14a16c4059820d9f054a8d857df671027 | [
"BSD-3-Clause"
] | null | null | null | tools/pnnx/tests/ncnn/test_F_hardtanh.py | CeasarLee/ncnn | 178825d14a16c4059820d9f054a8d857df671027 | [
"BSD-3-Clause"
] | null | null | null | tools/pnnx/tests/ncnn/test_F_hardtanh.py | CeasarLee/ncnn | 178825d14a16c4059820d9f054a8d857df671027 | [
"BSD-3-Clause"
] | null | null | null | # Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2021 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 o... | 28.596774 | 92 | 0.629442 |
import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
def forward(self, x, y, z):
x = F.hardtanh(x)
y = F.hardtanh(y, -1, 1)
z = F.hardtanh(z, -0.1, 0.1)
return x, y, z
... | true | true |
1c007e8700ddce1932b35490c5c3084a9988aa89 | 574 | py | Python | src/web/migrations/0002_auto_20200630_1111.py | ncthanhcs/backend | 3ce8a92363d6ab0e067188c95a636f84b179fa53 | [
"Apache-2.0"
] | null | null | null | src/web/migrations/0002_auto_20200630_1111.py | ncthanhcs/backend | 3ce8a92363d6ab0e067188c95a636f84b179fa53 | [
"Apache-2.0"
] | null | null | null | src/web/migrations/0002_auto_20200630_1111.py | ncthanhcs/backend | 3ce8a92363d6ab0e067188c95a636f84b179fa53 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.12 on 2020-06-30 04:11
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='movie',
name='date_public'... | 22.96 | 66 | 0.583624 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='movie',
name='date_public',
field=models.DateField(default=date... | true | true |
1c007f6a97d869220847e46616d87926c00d8258 | 11,602 | py | Python | hypha/apply/utils/pdfs.py | vaibhavmule/hypha | 0691438cd7904d9eb98b29678a38b3dd85f01465 | [
"BSD-3-Clause"
] | null | null | null | hypha/apply/utils/pdfs.py | vaibhavmule/hypha | 0691438cd7904d9eb98b29678a38b3dd85f01465 | [
"BSD-3-Clause"
] | null | null | null | hypha/apply/utils/pdfs.py | vaibhavmule/hypha | 0691438cd7904d9eb98b29678a38b3dd85f01465 | [
"BSD-3-Clause"
] | null | null | null | import io
import os
from itertools import cycle
from bs4 import BeautifulSoup, NavigableString
from reportlab.lib import pagesizes
from reportlab.lib.colors import Color, white
from reportlab.lib.styles import ParagraphStyle as PS
from reportlab.lib.utils import simpleSplit
from reportlab.pdfbase import pdfmetrics
fro... | 30.856383 | 151 | 0.611619 | import io
import os
from itertools import cycle
from bs4 import BeautifulSoup, NavigableString
from reportlab.lib import pagesizes
from reportlab.lib.colors import Color, white
from reportlab.lib.styles import ParagraphStyle as PS
from reportlab.lib.utils import simpleSplit
from reportlab.pdfbase import pdfmetrics
fro... | true | true |
1c007fc1c59809830aac0d33e08113084ffde5e0 | 156 | py | Python | cap_employee/employee/apps.py | bhargava-kush/cap_employee | 4c7eea3acd557c1aa861a5bc374f270f3acd52ee | [
"MIT"
] | null | null | null | cap_employee/employee/apps.py | bhargava-kush/cap_employee | 4c7eea3acd557c1aa861a5bc374f270f3acd52ee | [
"MIT"
] | null | null | null | cap_employee/employee/apps.py | bhargava-kush/cap_employee | 4c7eea3acd557c1aa861a5bc374f270f3acd52ee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class EmployeeConfig(AppConfig):
name = 'employee'
| 17.333333 | 39 | 0.737179 | from __future__ import unicode_literals
from django.apps import AppConfig
class EmployeeConfig(AppConfig):
name = 'employee'
| true | true |
1c00800f390e7ecd1dd46e85bbd9541881380020 | 629 | py | Python | practical9.py | himanshubalani/DSPDLab | 18ca05bc21c16025a9c87fcdf8de6dff6fe6218c | [
"MIT"
] | null | null | null | practical9.py | himanshubalani/DSPDLab | 18ca05bc21c16025a9c87fcdf8de6dff6fe6218c | [
"MIT"
] | null | null | null | practical9.py | himanshubalani/DSPDLab | 18ca05bc21c16025a9c87fcdf8de6dff6fe6218c | [
"MIT"
] | null | null | null | from collections import defaultdict
class Graph:
def __init__(self):
self.graph = defaultdict(list)
def addEdge(self,u,v):
self.graph[u].append(v)
def BFS(self, s):
visited = [False] * (max(self.graph) + 1)
queue = []
queue.append(s)
visited[s] = True
while queue:
s = queue.pop(0)
print (s, end... | 19.060606 | 45 | 0.620032 | from collections import defaultdict
class Graph:
def __init__(self):
self.graph = defaultdict(list)
def addEdge(self,u,v):
self.graph[u].append(v)
def BFS(self, s):
visited = [False] * (max(self.graph) + 1)
queue = []
queue.append(s)
visited[s] = True
while queue:
s = queue.pop(0)
print (s, end... | true | true |
1c00819593ee4b69b399bb496b61e5baba705739 | 671 | py | Python | indexd/auth/__init__.py | Quiltomics/indexd | 95274d40f16de881492c2db70a969eb77c8f5e7c | [
"Apache-2.0"
] | 2 | 2019-06-10T15:30:51.000Z | 2020-01-18T23:24:13.000Z | indexd/auth/__init__.py | lookcrabs/indexd | 646a7f336148496b07462ce3d3f8e930fa08a06c | [
"Apache-2.0"
] | 15 | 2019-03-19T21:57:31.000Z | 2021-08-11T21:01:33.000Z | indexd/auth/__init__.py | NCI-GDC/indexd | d159a82e7da100c807621bc41f2626dae64b4be9 | [
"Apache-2.0"
] | 1 | 2020-11-05T15:03:24.000Z | 2020-11-05T15:03:24.000Z | from functools import wraps
from flask import request
from flask import current_app
from .errors import AuthError
def authorize(f):
'''
Decorator for requiring auth.
Replaces the request authorization with a user context.
Raises AuthError if authorization fails.
'''
@wraps(f)
def check_au... | 24.851852 | 60 | 0.663189 | from functools import wraps
from flask import request
from flask import current_app
from .errors import AuthError
def authorize(f):
@wraps(f)
def check_auth(*args, **kwargs):
if not request.authorization:
raise AuthError('Username / password required.')
user = current_app.auth.aut... | true | true |
1c0081bfd12947b965640c7c614c0dcb20f3e49b | 751 | py | Python | PhotoHub/Hub/migrations/0018_auto_20220205_1415.py | akrhythm20/clickPhoto | 461735d750f4339e2f75d389dec98f0e7dc636c6 | [
"MIT"
] | null | null | null | PhotoHub/Hub/migrations/0018_auto_20220205_1415.py | akrhythm20/clickPhoto | 461735d750f4339e2f75d389dec98f0e7dc636c6 | [
"MIT"
] | null | null | null | PhotoHub/Hub/migrations/0018_auto_20220205_1415.py | akrhythm20/clickPhoto | 461735d750f4339e2f75d389dec98f0e7dc636c6 | [
"MIT"
] | 2 | 2022-01-26T15:15:16.000Z | 2022-01-28T13:17:06.000Z | # Generated by Django 3.1.6 on 2022-02-05 08:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Hub', '0017_auto_20220205_1414'),
]
operations = [
migrations.RenameField(
model_name='blog',
old_name='date1',
... | 22.088235 | 47 | 0.507324 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Hub', '0017_auto_20220205_1414'),
]
operations = [
migrations.RenameField(
model_name='blog',
old_name='date1',
new_name='date',
),
migrations.R... | true | true |
1c0081cf651cb07cdbeef128d3bc3f9f3746b711 | 927 | py | Python | src/py/comandoServer.py | wallamejorge/WirelessSensorGas | 868a5c3388daabc6f8be95386f676b12b5785bf2 | [
"Apache-2.0"
] | null | null | null | src/py/comandoServer.py | wallamejorge/WirelessSensorGas | 868a5c3388daabc6f8be95386f676b12b5785bf2 | [
"Apache-2.0"
] | null | null | null | src/py/comandoServer.py | wallamejorge/WirelessSensorGas | 868a5c3388daabc6f8be95386f676b12b5785bf2 | [
"Apache-2.0"
] | 3 | 2017-06-28T14:56:04.000Z | 2019-02-20T17:33:32.000Z | #!/usr/bin/python
import time, sys, subprocess,os
while True:
time.sleep(2)
comando = "scp -r root@192.168.7.2:~/Desktop/*.txt ./data" #Sustituir por el comando deseado
proceso = subprocess.Popen(comando , shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE)
print '...copying data files from BeagleBone to Se... | 37.08 | 105 | 0.704423 | import time, sys, subprocess,os
while True:
time.sleep(2)
comando = "scp -r root@192.168.7.2:~/Desktop/*.txt ./data" proceso = subprocess.Popen(comando , shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE)
print '...copying data files from BeagleBone to Server'
while True:
next_line = proceso.stdout.r... | false | true |
1c0081d2b594fcb1461811f6519d510065703cdf | 2,174 | py | Python | utils/params.py | thierrypin/gei-pool | 0a9e79b01148735f0e975c50d2476e41ba20af4f | [
"MIT"
] | null | null | null | utils/params.py | thierrypin/gei-pool | 0a9e79b01148735f0e975c50d2476e41ba20af4f | [
"MIT"
] | null | null | null | utils/params.py | thierrypin/gei-pool | 0a9e79b01148735f0e975c50d2476e41ba20af4f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import json
# from pydoc import locate
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('... | 28.605263 | 107 | 0.597976 |
import argparse
import json
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')
def read_params(json_path='params.json', make... | true | true |
1c00840f5d7573abed110a1108eb738a5bab51f2 | 3,280 | py | Python | parlai/tasks/visdial/agents.py | yzpang/ParlAI | b4eddf71154dc1f238491d4749a06841fb5e70b5 | [
"MIT"
] | 1 | 2019-12-04T20:00:28.000Z | 2019-12-04T20:00:28.000Z | parlai/tasks/visdial/agents.py | yzpang/ParlAI | b4eddf71154dc1f238491d4749a06841fb5e70b5 | [
"MIT"
] | 1 | 2020-04-16T16:20:52.000Z | 2020-04-17T19:12:21.000Z | parlai/tasks/visdial/agents.py | yzpang/ParlAI | b4eddf71154dc1f238491d4749a06841fb5e70b5 | [
"MIT"
] | 1 | 2020-04-16T15:56:29.000Z | 2020-04-16T15:56:29.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.core.teachers import DialogTeacher
from .build import build
from parlai.tasks.coco_caption.build_2014 import... | 32.156863 | 79 | 0.565244 |
from parlai.core.teachers import DialogTeacher
from .build import build
from parlai.tasks.coco_caption.build_2014 import buildImage
from PIL import Image
import json
import os
def _path(opt):
build(opt)
buildImage(opt)
dt = opt['datatype'].split(':')[0]
if dt == 'train':
suffix = 'train_tr... | true | true |
1c0085b15a0263b96bdd7b6358f046da3dbf087a | 11,281 | py | Python | kubernetes/client/models/v1_container_status.py | philipp-sontag-by/python | 51c481692ab0d9c71b9dd96342bfa93b721b029d | [
"Apache-2.0"
] | 1 | 2022-02-22T23:10:55.000Z | 2022-02-22T23:10:55.000Z | kubernetes/client/models/v1_container_status.py | philipp-sontag-by/python | 51c481692ab0d9c71b9dd96342bfa93b721b029d | [
"Apache-2.0"
] | 6 | 2021-09-13T19:03:02.000Z | 2022-03-16T18:56:42.000Z | kubernetes/client/models/v1_container_status.py | philipp-sontag-by/python | 51c481692ab0d9c71b9dd96342bfa93b721b029d | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 32.416667 | 299 | 0.617764 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class V1ContainerStatus(object):
openapi_types = {
'container_id': 'str',
'image': 'str',
'image_id': 'str',
'last_state': 'V1ContainerState',
'name': 'str',
'ready':... | true | true |
1c0086022dc97d6255c2236788bd4a6f922df4c8 | 1,628 | py | Python | examples/debug_ex.py | J0hnnyZhang/locust-plugins | da226e9a951c394ba1fb6e0561ff00eaaf852b16 | [
"Apache-2.0"
] | 242 | 2019-09-21T01:22:59.000Z | 2022-03-27T05:06:44.000Z | examples/debug_ex.py | J0hnnyZhang/locust-plugins | da226e9a951c394ba1fb6e0561ff00eaaf852b16 | [
"Apache-2.0"
] | 70 | 2020-02-10T09:28:39.000Z | 2022-03-29T20:23:59.000Z | examples/debug_ex.py | J0hnnyZhang/locust-plugins | da226e9a951c394ba1fb6e0561ff00eaaf852b16 | [
"Apache-2.0"
] | 77 | 2019-09-23T21:49:16.000Z | 2022-03-24T12:37:36.000Z | # Example of how to use VS Code debugger with Locust.
# Make sure you set "gevent": true in your launch.json
# In recent versions of VSCode you might get the following warning. I dont know why, but it seems safe to ignore.
#
# PYDEV DEBUGGER WARNING:
# sys.settrace() should not be used when the debugger is being used.... | 44 | 144 | 0.596437 |
from locust import task, HttpUser
from locust.exception import StopUser
from locust_plugins import run_single_user
class MyUser(HttpUser):
@task
def t(self):
self.client.get("/", context={"foo": 1})
self.client.get("/", context={"bar": 2})
raise StopUser()
if __name__ == "__main__"... | true | true |
1c0087158291c7bf0c0afc3315638aadb9dffc31 | 17,328 | py | Python | tests/tracer/test_writer.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/tracer/test_writer.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/tracer/test_writer.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import os
import socket
import tempfile
import threading
import time
import mock
import msgpack
import pytest
from ddtrace.compat import PY3
from ddtrace.compat import get_connection_response
from ddtrace.compat import httplib
from ddtrace.constants import KEEP_SPANS_RATE_KEY
from ddtrace.internal.uds import UDSHTTPC... | 34.725451 | 120 | 0.625981 | import os
import socket
import tempfile
import threading
import time
import mock
import msgpack
import pytest
from ddtrace.compat import PY3
from ddtrace.compat import get_connection_response
from ddtrace.compat import httplib
from ddtrace.constants import KEEP_SPANS_RATE_KEY
from ddtrace.internal.uds import UDSHTTPC... | true | true |
1c008788eb1d54e2ff62d1a87bab542f4c617994 | 1,097 | py | Python | one-minute/manage.py | hkawinzi/one-minute-pitch | 07a62b1467bcb7f6bc9a45aad8a5fb16717b9518 | [
"Unlicense"
] | null | null | null | one-minute/manage.py | hkawinzi/one-minute-pitch | 07a62b1467bcb7f6bc9a45aad8a5fb16717b9518 | [
"Unlicense"
] | null | null | null | one-minute/manage.py | hkawinzi/one-minute-pitch | 07a62b1467bcb7f6bc9a45aad8a5fb16717b9518 | [
"Unlicense"
] | null | null | null | # Import db from app factory
from app import create_app, db
from flask_script import Manager, Server
# Connect to models
from app.models import User, CommentsPromotion, CommentsPick, CommentsProduction, CommentsInterview
# Set up migrations
from flask_migrate import Migrate, MigrateCommand
# Creating app instance
# ... | 24.377778 | 182 | 0.759344 | from app import create_app, db
from flask_script import Manager, Server
from app.models import User, CommentsPromotion, CommentsPick, CommentsProduction, CommentsInterview
from flask_migrate import Migrate, MigrateCommand
app = create_app('development')
manager = Manager(app)
migrate = Migrate(app, db)
manager.a... | true | true |
1c0088186c030437454c0f764decab9e5a276adc | 175,687 | py | Python | tensorflow/contrib/layers/python/layers/layers_test.py | datanonymous/TFandroid | 89927e863b1ad96184ab09188f62b7e391c896d9 | [
"Apache-2.0"
] | 3 | 2019-02-04T10:10:19.000Z | 2019-12-29T08:09:37.000Z | tensorflow/contrib/layers/python/layers/layers_test.py | datanonymous/TFandroid | 89927e863b1ad96184ab09188f62b7e391c896d9 | [
"Apache-2.0"
] | 1 | 2019-07-27T16:45:02.000Z | 2019-07-27T16:45:02.000Z | tensorflow/contrib/layers/python/layers/layers_test.py | datanonymous/TFandroid | 89927e863b1ad96184ab09188f62b7e391c896d9 | [
"Apache-2.0"
] | 6 | 2018-11-29T20:52:00.000Z | 2021-02-19T22:43:32.000Z | # Copyright 2015 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... | 41.8402 | 80 | 0.676231 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
from tensorflow.contrib import layers as layers_lib
from tensorflow.contrib.framework.python.ops import arg_scope
from tensorflow.contrib.framework.python.ops import variables
... | true | true |
1c00889f1be4dee8c5098e2eb96d31df3d3f13e1 | 354 | py | Python | customblog/migrations/0001_initial.py | starshipfactory/sfblog | f62a712ab02f00c9d19b87797492506f51cab321 | [
"BSD-3-Clause"
] | 1 | 2017-09-03T18:13:43.000Z | 2017-09-03T18:13:43.000Z | customblog/migrations/0001_initial.py | starshipfactory/sfblog | f62a712ab02f00c9d19b87797492506f51cab321 | [
"BSD-3-Clause"
] | null | null | null | customblog/migrations/0001_initial.py | starshipfactory/sfblog | f62a712ab02f00c9d19b87797492506f51cab321 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
... | 17.7 | 50 | 0.655367 | from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['cu... | true | true |
1c0089122ffbac8b1a932598577b1fd99157bcb1 | 3,401 | py | Python | models/cb_ResNet18.py | flying-Yan/BCNN | 31ebb985cb1556b6f98aa71459ee74c3490bbe1d | [
"MIT"
] | 3 | 2021-12-14T15:38:08.000Z | 2021-12-19T10:34:24.000Z | models/cb_ResNet18.py | flying-Yan/BCNN | 31ebb985cb1556b6f98aa71459ee74c3490bbe1d | [
"MIT"
] | 1 | 2022-03-09T08:18:34.000Z | 2022-03-09T08:18:34.000Z | models/cb_ResNet18.py | flying-Yan/BCNN | 31ebb985cb1556b6f98aa71459ee74c3490bbe1d | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from models.binarized_fun import *
class ResBlock_1(nn.Module):
def __init__(self, inchannel):
super(ResBlock_1, self).__init__()
self.tanh = nn.Hardtanh(-1.3,1.3)
self.conv1 = nn.Sequential(
self.tanh,
... | 26.161538 | 111 | 0.487504 | import torch
import torch.nn as nn
from models.binarized_fun import *
class ResBlock_1(nn.Module):
def __init__(self, inchannel):
super(ResBlock_1, self).__init__()
self.tanh = nn.Hardtanh(-1.3,1.3)
self.conv1 = nn.Sequential(
self.tanh,
... | true | true |
1c008aa4e35d24867ef001354809c8e5b3dff7b5 | 1,705 | py | Python | botfw/bitflyer/websocket.py | lzpel/btc_bot_framework | abb585e1cd8b70297ef29d529e2da75046409f4b | [
"MIT"
] | 115 | 2019-11-29T23:48:37.000Z | 2022-03-25T11:07:21.000Z | botfw/bitflyer/websocket.py | lzpel/btc_bot_framework | abb585e1cd8b70297ef29d529e2da75046409f4b | [
"MIT"
] | 15 | 2019-12-05T07:31:05.000Z | 2022-02-07T02:34:47.000Z | botfw/bitflyer/websocket.py | lzpel/btc_bot_framework | abb585e1cd8b70297ef29d529e2da75046409f4b | [
"MIT"
] | 38 | 2019-11-30T00:06:04.000Z | 2022-03-22T08:40:03.000Z | import time
import secrets
from ..base.websocket import WebsocketBase
from ..etc.util import hmac_sha256
class BitflyerWebsocket(WebsocketBase):
ENDPOINT = 'wss://ws.lightstream.bitflyer.com/json-rpc'
def command(self, op, args=None, cb=None):
msg = {'method': op, 'id': self._request_id}
if ... | 31.574074 | 71 | 0.511437 | import time
import secrets
from ..base.websocket import WebsocketBase
from ..etc.util import hmac_sha256
class BitflyerWebsocket(WebsocketBase):
ENDPOINT = 'wss://ws.lightstream.bitflyer.com/json-rpc'
def command(self, op, args=None, cb=None):
msg = {'method': op, 'id': self._request_id}
if ... | true | true |
1c008b91ddeb35c6a49b6dfb48a8e3ee70258b5c | 598 | py | Python | run.py | dennishumes/Flask-Easy-Template | 8584d384f75281b8bf1915a02699d3fc569df3b0 | [
"Apache-2.0"
] | null | null | null | run.py | dennishumes/Flask-Easy-Template | 8584d384f75281b8bf1915a02699d3fc569df3b0 | [
"Apache-2.0"
] | null | null | null | run.py | dennishumes/Flask-Easy-Template | 8584d384f75281b8bf1915a02699d3fc569df3b0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import tornado
from tornado import autoreload
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.log import enable_pretty_logging
from application import app
enable_pretty_logging()
PORT = 5000
---... | 22.148148 | 45 | 0.752508 |
import tornado
from tornado import autoreload
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.log import enable_pretty_logging
from application import app
enable_pretty_logging()
PORT = 5000
------- PRODUCTION CONFIG -------
http_serve... | false | true |
1c008bee00d8341b0384fba14c0697628130bb66 | 3,976 | py | Python | Lib/test/test_gc.py | SaadBazaz/ChinesePython | 800955539dda912d4a1621bcf5a700aaaddc012f | [
"CNRI-Python-GPL-Compatible"
] | 3 | 2022-01-30T20:08:24.000Z | 2022-02-12T08:51:12.000Z | Lib/test/test_gc.py | SaadBazaz/ChinesePython | 800955539dda912d4a1621bcf5a700aaaddc012f | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/test/test_gc.py | SaadBazaz/ChinesePython | 800955539dda912d4a1621bcf5a700aaaddc012f | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | from test_support import verify, verbose, TestFailed
import gc
def run_test(name, thunk):
if verbose:
print "testing %s..." % name,
try:
thunk()
except TestFailed:
if verbose:
print "failed (expected %s but got %s)" % (result,
... | 21.726776 | 74 | 0.552062 | from test_support import verify, verbose, TestFailed
import gc
def run_test(name, thunk):
if verbose:
print "testing %s..." % name,
try:
thunk()
except TestFailed:
if verbose:
print "failed (expected %s but got %s)" % (result,
... | false | true |
1c008bfaffd125bf2ebe8e07c042e18fbc7aa25b | 11,323 | py | Python | automato2.py | vitorduarte/Cyton-Robot-Control | 028f8f276a07bbdeafbf87df2814662d8211e0aa | [
"MIT"
] | null | null | null | automato2.py | vitorduarte/Cyton-Robot-Control | 028f8f276a07bbdeafbf87df2814662d8211e0aa | [
"MIT"
] | null | null | null | automato2.py | vitorduarte/Cyton-Robot-Control | 028f8f276a07bbdeafbf87df2814662d8211e0aa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# AUTOMATO DE EVENTOS NÃO CONTROLÁVEIS
import rospy
from std_msgs.msg import Int8
from std_msgs.msg import String
#######################################
### FUNÇÕES DE CALLBACK - NÃO MEXER ###
#######################################
# Callback para novo evento
def ev... | 21.943798 | 93 | 0.579263 |
import rospy
from std_msgs.msg import Int8
from std_msgs.msg import String
def eventCallback(data):
print('eventCallback')
global newEvent
newEvent = data.data
def sendMovement(move):
print('sendMovement')
print(move)
global pub
moveToSend = Int8()
moveToSend = move
pub.publ... | true | true |
1c008c992298f6311263afe89ea797e8072fa90e | 3,781 | py | Python | app.py | Arryboom/flask_webshell | ac9b50637857084d11a79e92a5dfbbaf14106c4d | [
"MIT"
] | null | null | null | app.py | Arryboom/flask_webshell | ac9b50637857084d11a79e92a5dfbbaf14106c4d | [
"MIT"
] | null | null | null | app.py | Arryboom/flask_webshell | ac9b50637857084d11a79e92a5dfbbaf14106c4d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import subprocess
from flask import Flask, render_template,request
from flask_socketio import SocketIO, send, emit
import base64
HTML = '''
<html>
<head>
<title>WEBSHELL</title>
<script type="text/javascript" src="//code.jquery.com/jquery-3.2.1.min.js"></script>
<!--<... | 34.372727 | 127 | 0.517588 |
import subprocess
from flask import Flask, render_template,request
from flask_socketio import SocketIO, send, emit
import base64
HTML = '''
<html>
<head>
<title>WEBSHELL</title>
<script type="text/javascript" src="//code.jquery.com/jquery-3.2.1.min.js"></script>
<!--<script type="text/java... | true | true |
1c008d073807241a0c15e5022f3f8a20c53350a6 | 3,445 | py | Python | translation_source/src/apply_translation_sheet.py | Shinjjanggu/jakhonplus | 2b6a60dc323d063a47377c0082bed1b1d759d5f6 | [
"MIT"
] | 1 | 2020-07-07T15:09:42.000Z | 2020-07-07T15:09:42.000Z | translation_source/src/apply_translation_sheet.py | Shinjjanggu/jakhonplus | 2b6a60dc323d063a47377c0082bed1b1d759d5f6 | [
"MIT"
] | 12 | 2020-07-07T14:54:21.000Z | 2022-01-13T03:17:09.000Z | translation_source/src/apply_translation_sheet.py | Shinjjanggu/jakhonplus | 2b6a60dc323d063a47377c0082bed1b1d759d5f6 | [
"MIT"
] | null | null | null | #! /usr/bin/python
import csv
import re
from pathlib import Path
import os
from common import log_normal, log_debug, log_warn, log_info, log_error
lang = os.getenv('MAJSOUL_LANG', 'jp')
verbose = int(os.getenv('MAJSOUL_VERBOSE', 0)) == 1
def main(translation_path, temp_path):
log_normal('Apply translate_sheet.csv ... | 39.597701 | 102 | 0.516691 | import csv
import re
from pathlib import Path
import os
from common import log_normal, log_debug, log_warn, log_info, log_error
lang = os.getenv('MAJSOUL_LANG', 'jp')
verbose = int(os.getenv('MAJSOUL_VERBOSE', 0)) == 1
def main(translation_path, temp_path):
log_normal('Apply translate_sheet.csv to original csv fil... | true | true |
1c008d0cd0ffa1cb210c4dca87ce41ce81547b15 | 3,340 | py | Python | learning_to_simulate/render_rollout.py | mitchchristow/deepmind-research | 49c7ebe6acc48dd276ca09eca6924ba6cb5ec3a3 | [
"Apache-2.0"
] | 10,110 | 2019-08-27T20:05:30.000Z | 2022-03-31T16:31:56.000Z | learning_to_simulate/render_rollout.py | ibex-training/deepmind-research | 6f8ae40b2626b30f5f80dfc92f5676689eff5599 | [
"Apache-2.0"
] | 317 | 2019-11-09T10:19:10.000Z | 2022-03-31T00:05:19.000Z | learning_to_simulate/render_rollout.py | ibex-training/deepmind-research | 6f8ae40b2626b30f5f80dfc92f5676689eff5599 | [
"Apache-2.0"
] | 2,170 | 2019-08-28T12:53:36.000Z | 2022-03-31T13:15:11.000Z | # Lint as: python3
# pylint: disable=g-bad-file-header
# Copyright 2020 DeepMind Technologies Limited. 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.a... | 32.115385 | 95 | 0.68024 |
import pickle
from absl import app
from absl import flags
from matplotlib import animation
import matplotlib.pyplot as plt
import numpy as np
flags.DEFINE_string("rollout_path", None, help="Path to rollout pickle file")
flags.DEFINE_integer("step_stride", 3, help="Stride of steps to skip.")
flags.DEFINE_boolean("bl... | true | true |
1c008d6ff61d0f08085145854074bc3662d1ed42 | 16,044 | py | Python | deprecated/hyppo_testing/hypppo2.py | TauferLab/SOMOSPIE | 512bfc1a287d014f3c3d885a22b23825ce536c92 | [
"BSD-3-Clause"
] | null | null | null | deprecated/hyppo_testing/hypppo2.py | TauferLab/SOMOSPIE | 512bfc1a287d014f3c3d885a22b23825ce536c92 | [
"BSD-3-Clause"
] | null | null | null | deprecated/hyppo_testing/hypppo2.py | TauferLab/SOMOSPIE | 512bfc1a287d014f3c3d885a22b23825ce536c92 | [
"BSD-3-Clause"
] | 3 | 2020-02-14T14:31:50.000Z | 2022-01-04T16:51:40.000Z | #!/usr/bin/env python3
# Code by Travis Johnston, 2017.
# Modified and parallelized by Danny Rorabaugh, 2018/9.
# HYbrid Parallel Piecewise POlynomial.
import argparse, csv, random
import numpy as np
### https://docs.python.org/3.1/library/itertools.html#itertools.combinations_with_replacement
from itertools import ... | 47.75 | 193 | 0.667851 |
import argparse, csv, random
import numpy as np
from itertools import combinations_with_replacement as cwr
from time import time
import os
def init_parallel():
print(f"There are {os.cpu_count()} cores, of which {len(os.sched_getaffinity(0))} are available.")
import findspark
findspark.init()
... | true | true |
1c008dbb528854cc4952f6a5fd596936255c7fe2 | 649 | py | Python | farms2face/home/migrations/0008_customfacepack_questionnaire.py | dev1farms2face/f2f | 54e58187a68574bf2bd0dfb7e58a2b416336106a | [
"MIT"
] | null | null | null | farms2face/home/migrations/0008_customfacepack_questionnaire.py | dev1farms2face/f2f | 54e58187a68574bf2bd0dfb7e58a2b416336106a | [
"MIT"
] | null | null | null | farms2face/home/migrations/0008_customfacepack_questionnaire.py | dev1farms2face/f2f | 54e58187a68574bf2bd0dfb7e58a2b416336106a | [
"MIT"
] | 2 | 2018-06-19T12:12:08.000Z | 2018-06-25T18:45:36.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-20 15:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('facepackwizard', '0004_auto_20170324_1818'),
('home',... | 28.217391 | 135 | 0.679507 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('facepackwizard', '0004_auto_20170324_1818'),
('home', '0007_remove_customfacepack_questionnaire'),
]
operations = [... | true | true |
1c008dfbd4cc81a422e260b1c1be1e27f276650d | 7,278 | py | Python | tensorflow/python/tpu/tpu_system_metadata.py | Sonata-Wang/tensorflow | 8bbef0cd77879d05ed69bf30e76087847a8ca4a2 | [
"Apache-2.0"
] | 6 | 2019-02-05T22:36:51.000Z | 2022-01-14T03:50:57.000Z | tensorflow/python/tpu/tpu_system_metadata.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | 1 | 2019-09-14T04:40:07.000Z | 2020-11-18T18:16:17.000Z | tensorflow/python/tpu/tpu_system_metadata.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | 8 | 2016-01-14T13:12:56.000Z | 2021-04-09T10:20:53.000Z | # Copyright 2018 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... | 36.39 | 80 | 0.691261 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import re
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.client import session as session_lib
from tensorflow.python.framework import errors
from tensorflow.python.f... | true | true |
1c008dfbee0057cccce6075c79f2804937177b14 | 1,579 | py | Python | var/spack/repos/sdsc/packages/spades/package.py | sdsc/spack | dc1c6571979fb29d89accdf27e8915952bffe780 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/sdsc/packages/spades/package.py | sdsc/spack | dc1c6571979fb29d89accdf27e8915952bffe780 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/sdsc/packages/spades/package.py | sdsc/spack | dc1c6571979fb29d89accdf27e8915952bffe780 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-01-05T20:00:52.000Z | 2021-01-05T20:00:52.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 Spades(CMakePackage):
"""SPAdes - St. Petersburg genome assembler - is intended for both
... | 45.114286 | 96 | 0.757441 |
from spack import *
class Spades(CMakePackage):
homepage = "http://cab.spbu.ru/software/spades/"
url = "https://github.com/ablab/spades/releases/download/v3.15.0/SPAdes-3.15.0.tar.gz"
version('3.15.2', sha256='e93b43951a814dc7bd6a246e1e863bbad6aac4bfe1928569402c131b2af99d0d')
version('3.15.1',... | true | true |
1c008e969c5d91e316e8c57253ab270101224eab | 17,536 | py | Python | south_migrations/0016_auto__del_field_newsentry_author_user.py | yoursantu/indiannewsplus | 252f0367b43ec2edea636157bcf2d8a92dda6f3f | [
"MIT"
] | null | null | null | south_migrations/0016_auto__del_field_newsentry_author_user.py | yoursantu/indiannewsplus | 252f0367b43ec2edea636157bcf2d8a92dda6f3f | [
"MIT"
] | null | null | null | south_migrations/0016_auto__del_field_newsentry_author_user.py | yoursantu/indiannewsplus | 252f0367b43ec2edea636157bcf2d8a92dda6f3f | [
"MIT"
] | null | null | null | # flake8: noqa
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'NewsEntry.author_user'
db.delete_column(... | 85.541463 | 218 | 0.573107 | from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.delete_column(u'multilingual_news_newsentry', 'author_user_id')
def backwards(self, orm)... | true | true |
1c008ecec82d50665ceba90d3892230a248c7fd3 | 22,442 | py | Python | whynot/causal_graphs.py | yoshavit/whynot | e33e56bae377b65fe87feac5c6246ae38f4586e8 | [
"MIT"
] | 376 | 2020-03-20T20:09:16.000Z | 2022-03-29T09:53:33.000Z | whynot/causal_graphs.py | mrtzh/whynot | 0668f0a0c1e80defec6e4678f85ed60f45226477 | [
"MIT"
] | 5 | 2020-04-20T10:19:34.000Z | 2021-11-03T09:36:28.000Z | whynot/causal_graphs.py | mrtzh/whynot | 0668f0a0c1e80defec6e4678f85ed60f45226477 | [
"MIT"
] | 41 | 2020-03-20T23:14:38.000Z | 2022-03-09T06:02:01.000Z | """Functions for constructing and analyzing causal graphs."""
from collections.abc import Iterable
import types
import dataclasses
from autograd.extend import primitive
from autograd.numpy.numpy_boxes import ArrayBox
from autograd.tracer import Box, isbox, new_box, Node, trace_stack
import networkx as nx
import numpy... | 36.790164 | 95 | 0.618216 | from collections.abc import Iterable
import types
import dataclasses
from autograd.extend import primitive
from autograd.numpy.numpy_boxes import ArrayBox
from autograd.tracer import Box, isbox, new_box, Node, trace_stack
import networkx as nx
import numpy as np
import whynot as wn
for type_ in [bool, np.bool, np.b... | true | true |
1c008ecf4b27fdbcdcd6e32d0c72f77471458507 | 1,419 | py | Python | text_utils/string_normalization.py | Jacen789/dp_utils | a433da7895304e6e2fae103e1b621eb4bc535a90 | [
"MIT"
] | 1 | 2021-04-12T07:05:27.000Z | 2021-04-12T07:05:27.000Z | text_utils/string_normalization.py | Jacen789/dp_utils | a433da7895304e6e2fae103e1b621eb4bc535a90 | [
"MIT"
] | null | null | null | text_utils/string_normalization.py | Jacen789/dp_utils | a433da7895304e6e2fae103e1b621eb4bc535a90 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
import unicodedata
def string_normalize(text, form='NFKC'):
"""字符串规范化"""
text = unicodedata.normalize(form, text)
return text
def string_normalize_file(input_file, output_file, form='NFKC'):
"""
字符串规范化,用于文件
:param input_file: 输入文件路径
:param output_... | 28.959184 | 78 | 0.609584 |
import argparse
import unicodedata
def string_normalize(text, form='NFKC'):
text = unicodedata.normalize(form, text)
return text
def string_normalize_file(input_file, output_file, form='NFKC'):
if form not in ['NFC', 'NFKC', 'NFD', 'NFKD']:
raise ValueError("Unknown mode %s" % form)
with op... | true | true |
1c008f3ec6d65b3e980e2f1c3ea8720869d7d000 | 131,603 | py | Python | Validation/HGCalValidation/python/hgcalPlots.py | Xingfu23/cmssw | c82c0fefefd6b377b74d37073bb4f19ce7430068 | [
"Apache-2.0"
] | null | null | null | Validation/HGCalValidation/python/hgcalPlots.py | Xingfu23/cmssw | c82c0fefefd6b377b74d37073bb4f19ce7430068 | [
"Apache-2.0"
] | null | null | null | Validation/HGCalValidation/python/hgcalPlots.py | Xingfu23/cmssw | c82c0fefefd6b377b74d37073bb4f19ce7430068 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import sys
import copy
import collections
import six
import ROOT
from ROOT import TFile
from ROOT import gDirectory
ROOT.gROOT.SetBatch(True)
ROOT.PyConfig.IgnoreCommandLineOptions = True
from Validation.RecoTrack.plotting.plotting import Plot, PlotGroup, PlotFolder, Pl... | 60.451539 | 279 | 0.72531 | from __future__ import print_function
import os
import sys
import copy
import collections
import six
import ROOT
from ROOT import TFile
from ROOT import gDirectory
ROOT.gROOT.SetBatch(True)
ROOT.PyConfig.IgnoreCommandLineOptions = True
from Validation.RecoTrack.plotting.plotting import Plot, PlotGroup, PlotFolder, Pl... | true | true |
1c008f729d6ea5b2e70704cb63a340247f26c1cd | 12,151 | py | Python | syntaxnet/syntaxnet/parser_trainer.py | CLC-HCMUS/models | 0102dfb62644602c319164aea6530510656046e4 | [
"Apache-2.0"
] | 9 | 2021-08-08T22:44:58.000Z | 2021-11-23T06:51:59.000Z | syntaxnet/syntaxnet/parser_trainer.py | shankar-reddy/models | 0102dfb62644602c319164aea6530510656046e4 | [
"Apache-2.0"
] | null | null | null | syntaxnet/syntaxnet/parser_trainer.py | shankar-reddy/models | 0102dfb62644602c319164aea6530510656046e4 | [
"Apache-2.0"
] | 2 | 2018-04-04T17:12:55.000Z | 2018-04-17T21:15:22.000Z | # Copyright 2016 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.970395 | 80 | 0.657806 |
import os
import os.path
import time
import tensorflow as tf
from tensorflow.python.platform import gfile
from tensorflow.python.platform import logging
from google.protobuf import text_format
from syntaxnet import graph_builder
from syntaxnet import structured_graph_builder
from syntaxnet.ops import gen_parser... | true | true |
1c008f983f316e0964c6eeee52299a9905663e45 | 2,044 | py | Python | curation_projects/veda/ignca/vaajasaneyi_kaaNva.py | lalitaalaalitah/doc_curation | d26072dc5afd645019788b4844058da5d0c63ebe | [
"MIT"
] | null | null | null | curation_projects/veda/ignca/vaajasaneyi_kaaNva.py | lalitaalaalitah/doc_curation | d26072dc5afd645019788b4844058da5d0c63ebe | [
"MIT"
] | null | null | null | curation_projects/veda/ignca/vaajasaneyi_kaaNva.py | lalitaalaalitah/doc_curation | d26072dc5afd645019788b4844058da5d0c63ebe | [
"MIT"
] | null | null | null | import logging
import os
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome import options
from selenium.webdriver.remote.remote_connection import LOGGER
from doc_curation import text_data
from doc_curation.md_helper import MdFile
from indic_tra... | 36.5 | 135 | 0.716732 | import logging
import os
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome import options
from selenium.webdriver.remote.remote_connection import LOGGER
from doc_curation import text_data
from doc_curation.md_helper import MdFile
from indic_tra... | true | true |
1c008feb1dd7be0a7560ac85f89e697c3bebc6d7 | 9,569 | py | Python | src/reseau/connexions/client_connecte.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/reseau/connexions/client_connecte.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/reseau/connexions/client_connecte.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# lis... | 33.575439 | 82 | 0.62901 |
try:
import socket
import telnetlib
DO, DONT, WILL, WONT = telnetlib.DO[0], telnetlib.DONT[0], \
telnetlib.WILL[0], telnetlib.WONT[0]
except ImportError:
socket = None
ENCODAGES = [
'utf-8',
'iso-8859-15',
'cp850',
'cp1252',
]
class ClientConnecte:
id_courant = 0
... | true | true |
1c00911555f42537677090b5a6e79c4b2e2bc6e1 | 7,496 | py | Python | mdp.py | magnetar-iiith/PRIL | dea35169ca823115b96b8fe88ca7ef545b353b08 | [
"MIT"
] | 1 | 2021-12-02T12:16:20.000Z | 2021-12-02T12:16:20.000Z | mdp.py | magnetar-iiith/PRIL | dea35169ca823115b96b8fe88ca7ef545b353b08 | [
"MIT"
] | null | null | null | mdp.py | magnetar-iiith/PRIL | dea35169ca823115b96b8fe88ca7ef545b353b08 | [
"MIT"
] | null | null | null | from gym.envs.toy_text import discrete
from cvxopt import matrix, solvers
import numpy as np
MAPS = {
"4x4": ["SFFF","FHFH","FFFH","HFFG"],
"8x8": ["SFFFFFFF","FFFOOFFF","FFFHFFFF","FFFFFHFF","FFFHFFFF","FHHFFFHF","FHFFHFHF","FFFHFFFG"],
"5x5_a": ["SOFFF","FOFOF","FOFOF","FOFOF","FFFOG"],
"5x5_b": ["SFF... | 45.98773 | 147 | 0.526014 | from gym.envs.toy_text import discrete
from cvxopt import matrix, solvers
import numpy as np
MAPS = {
"4x4": ["SFFF","FHFH","FFFH","HFFG"],
"8x8": ["SFFFFFFF","FFFOOFFF","FFFHFFFF","FFFFFHFF","FFFHFFFF","FHHFFFHF","FHFFHFHF","FFFHFFFG"],
"5x5_a": ["SOFFF","FOFOF","FOFOF","FOFOF","FFFOG"],
"5x5_b": ["SFF... | true | true |
1c00919f4540afb2fad39dd503712e3dfc446d8d | 982 | py | Python | AIPscan/__init__.py | artefactual-labs/AIPscan | c11125b0b201d2ba0dd491ba40f2a56c90dd824c | [
"Apache-2.0"
] | 5 | 2020-07-07T18:37:39.000Z | 2022-01-12T18:49:52.000Z | AIPscan/__init__.py | artefactual-labs/AIPscan | c11125b0b201d2ba0dd491ba40f2a56c90dd824c | [
"Apache-2.0"
] | 135 | 2020-06-18T04:05:37.000Z | 2021-12-22T17:43:03.000Z | AIPscan/__init__.py | artefactual-labs/AIPscan | c11125b0b201d2ba0dd491ba40f2a56c90dd824c | [
"Apache-2.0"
] | 1 | 2021-09-02T08:32:33.000Z | 2021-09-02T08:32:33.000Z | # -*- coding: utf-8 -*-
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from AIPscan.celery import configure_celery
from config import CONFIGS
db = SQLAlchemy()
def create_app(config_name="default"):
"""Flask app factory, returns app instance."""
app = Flask(__name__)
app.config.from_o... | 25.842105 | 68 | 0.695519 |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from AIPscan.celery import configure_celery
from config import CONFIGS
db = SQLAlchemy()
def create_app(config_name="default"):
app = Flask(__name__)
app.config.from_object(CONFIGS[config_name])
with app.app_context():
from AIPs... | true | true |
1c00928862d99b9eb503c3c304c10caf8a1ff8df | 2,831 | py | Python | Flask/tests/test_live_server.py | dc-artem/working-with-python | 4da6b82e50c08486937fe7d655d34b82317705df | [
"Apache-2.0"
] | null | null | null | Flask/tests/test_live_server.py | dc-artem/working-with-python | 4da6b82e50c08486937fe7d655d34b82317705df | [
"Apache-2.0"
] | 1 | 2020-12-26T18:40:29.000Z | 2020-12-26T18:40:29.000Z | Flask/tests/test_live_server.py | dc-artem/working-with-python | 4da6b82e50c08486937fe7d655d34b82317705df | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
from flask import url_for
class TestLiveServer:
def test_server_is_alive(self, live_server):
assert live_server._process
assert live_server.... | 33.305882 | 95 | 0.615684 | import pytest
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
from flask import url_for
class TestLiveServer:
def test_server_is_alive(self, live_server):
assert live_server._process
assert live_server._process.is_alive()
def test_server_url(s... | true | true |
1c0092f1af8e87551f24f2b3d4d09bb71e9837e8 | 185 | py | Python | 2021-03/demo004.py | zhouyuanmin/MyDemo | 664977a6243992c77931e58b98f5262745759d1a | [
"MIT"
] | null | null | null | 2021-03/demo004.py | zhouyuanmin/MyDemo | 664977a6243992c77931e58b98f5262745759d1a | [
"MIT"
] | null | null | null | 2021-03/demo004.py | zhouyuanmin/MyDemo | 664977a6243992c77931e58b98f5262745759d1a | [
"MIT"
] | null | null | null | import requests
url = "https://api.dingdangcode.com/ddc-port/play/userPraise?worksId=48359"
for i in range(2000):
response = requests.get(url)
print(i, "--> ", response.text)
| 23.125 | 75 | 0.691892 | import requests
url = "https://api.dingdangcode.com/ddc-port/play/userPraise?worksId=48359"
for i in range(2000):
response = requests.get(url)
print(i, "--> ", response.text)
| true | true |
1c00951bfc77c1e18fe1a01cac913f8cdc02de80 | 20,463 | py | Python | tensorflow/python/layers/core_test.py | jhabikal21/tensorflow | 98d20962172301385aae694141801a375debd2bc | [
"Apache-2.0"
] | null | null | null | tensorflow/python/layers/core_test.py | jhabikal21/tensorflow | 98d20962172301385aae694141801a375debd2bc | [
"Apache-2.0"
] | null | null | null | tensorflow/python/layers/core_test.py | jhabikal21/tensorflow | 98d20962172301385aae694141801a375debd2bc | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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... | 41.339394 | 99 | 0.69677 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.fra... | true | true |
1c00958f7f8b5ee165c98e36a6adcb80016e9055 | 1,862 | py | Python | lingvo/core/base_model_params_test.py | Harshs27/lingvo | bd396e651488b2e2c4a7416be077b4a0226c87c8 | [
"Apache-2.0"
] | 62 | 2021-03-07T06:15:48.000Z | 2022-03-24T18:58:57.000Z | lingvo/core/base_model_params_test.py | Harshs27/lingvo | bd396e651488b2e2c4a7416be077b4a0226c87c8 | [
"Apache-2.0"
] | 59 | 2021-02-26T21:37:03.000Z | 2022-03-24T16:57:12.000Z | lingvo/core/base_model_params_test.py | Harshs27/lingvo | bd396e651488b2e2c4a7416be077b4a0226c87c8 | [
"Apache-2.0"
] | 9 | 2021-02-26T21:34:11.000Z | 2022-02-09T04:00:50.000Z | # Lint as: python3
# Copyright 2018 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 ... | 42.318182 | 80 | 0.745972 |
import lingvo.compat as tf
from lingvo.core import base_model_params
from lingvo.core import test_utils
class BaseModelParamsTest(test_utils.TestCase):
def testGetDatasetParams_SingleTaskModelParams(self):
dummy_model = base_model_params.SingleTaskModelParams()
self.assertEqual(dummy_model.Train(), dummy_... | true | true |
1c0097725957161f64a58b7c619a2ee0c8f4137a | 4,016 | py | Python | examples/stack/stack.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 90 | 2015-04-07T10:26:53.000Z | 2022-03-07T15:14:57.000Z | examples/stack/stack.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 14 | 2015-10-13T16:25:59.000Z | 2021-01-21T18:31:03.000Z | examples/stack/stack.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 32 | 2015-04-07T10:41:29.000Z | 2022-02-26T05:17:28.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This module implements a linked list based stack data structure.
A stack is a data structure to hold a collection of items in which operations
such as the addition of an item (*push*) and removal of an item (*pop*) can
be performed. The items are always pushed or poppe... | 30.424242 | 79 | 0.59512 |
class _Node(object):
def __init__(self, item):
self.item = item
self.next = None
class Stack(object):
def __init__(self):
self._head = None
self._size = 0
@property
def size(self):
return self._size
def isEmpty(self):
return self._size == 0
... | true | true |
1c009826433a6edca23fbda271087b1f7f2272d4 | 3,174 | py | Python | brainframe_qt/ui/resources/alarms/alarm_bundle/alarm_card/alert_log/alert_log_entry/alert_preview/alert_detail/alert_detail.py | aotuai/brainframe-qt | 082cfd0694e569122ff7c63e56dd0ec4b62d5bac | [
"BSD-3-Clause"
] | 17 | 2021-02-11T18:19:22.000Z | 2022-02-08T06:12:50.000Z | brainframe_qt/ui/resources/alarms/alarm_bundle/alarm_card/alert_log/alert_log_entry/alert_preview/alert_detail/alert_detail.py | aotuai/brainframe-qt | 082cfd0694e569122ff7c63e56dd0ec4b62d5bac | [
"BSD-3-Clause"
] | 80 | 2021-02-11T08:27:31.000Z | 2021-10-13T21:33:22.000Z | brainframe_qt/ui/resources/alarms/alarm_bundle/alarm_card/alert_log/alert_log_entry/alert_preview/alert_detail/alert_detail.py | aotuai/brainframe-qt | 082cfd0694e569122ff7c63e56dd0ec4b62d5bac | [
"BSD-3-Clause"
] | 5 | 2021-02-12T09:51:34.000Z | 2022-02-08T09:25:15.000Z | import typing
from typing import List, Union, Tuple
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget, QLabel, QVBoxLayout, QSizePolicy
from brainframe_qt.api_utils import api
from brainframe.api import bf_codecs
from brainframe_qt.ui.resources import stylesheet_watcher, QTAsyncWorker
from brainframe_qt... | 30.519231 | 75 | 0.664776 | import typing
from typing import List, Union, Tuple
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget, QLabel, QVBoxLayout, QSizePolicy
from brainframe_qt.api_utils import api
from brainframe.api import bf_codecs
from brainframe_qt.ui.resources import stylesheet_watcher, QTAsyncWorker
from brainframe_qt... | true | true |
1c0098d55fc1eb9c161946e80941320523f2be86 | 4,967 | py | Python | CAAPR/CAAPR_Main.py | Stargrazer82301/CAAPR | 4adead7dd85072cf14e2afb0f6b99b4f92d34201 | [
"MIT"
] | 7 | 2016-05-20T21:56:39.000Z | 2022-02-07T21:09:48.000Z | CAAPR/CAAPR_Main.py | Stargrazer82301/CAAPR | 4adead7dd85072cf14e2afb0f6b99b4f92d34201 | [
"MIT"
] | 1 | 2019-03-21T16:10:04.000Z | 2019-03-22T17:21:56.000Z | CAAPR/CAAPR_Main.py | Stargrazer82301/CAAPR | 4adead7dd85072cf14e2afb0f6b99b4f92d34201 | [
"MIT"
] | 1 | 2020-05-19T16:17:17.000Z | 2020-05-19T16:17:17.000Z | # Import smorgasbord
import sys
import os
import gc
import time
import random
#import warnings
#warnings.filterwarnings('ignore')
import matplotlib
matplotlib.use('Agg')
import multiprocessing as mp
import CAAPR
import CAAPR.CAAPR_IO
import CAAPR.CAAPR_Pipeline
import pdb
# Define the function th... | 35.22695 | 150 | 0.648883 | import sys
import os
import gc
import time
import random
import matplotlib
matplotlib.use('Agg')
import multiprocessing as mp
import CAAPR
import CAAPR.CAAPR_IO
import CAAPR.CAAPR_Pipeline
import pdb
def Run(bands_table_path = '../CAAPR_Example/CAAPR_Band_Table.csv',
sources_table_path = '.... | true | true |
1c009a8b5612705ee6a4734900bc1fa916878288 | 5,725 | py | Python | mmocr/apis/inference.py | HXPRedBlue/mmocr | 914613d53484712be67c38d50bb902a218884b24 | [
"Apache-2.0"
] | 1 | 2021-07-11T07:49:20.000Z | 2021-07-11T07:49:20.000Z | mmocr/apis/inference.py | HXPRedBlue/mmocr | 914613d53484712be67c38d50bb902a218884b24 | [
"Apache-2.0"
] | null | null | null | mmocr/apis/inference.py | HXPRedBlue/mmocr | 914613d53484712be67c38d50bb902a218884b24 | [
"Apache-2.0"
] | 1 | 2021-11-24T09:29:24.000Z | 2021-11-24T09:29:24.000Z | import numpy as np
import torch
from mmcv.ops import RoIPool
from mmcv.parallel import collate, scatter
from mmdet.datasets import replace_ImageToTensor
from mmdet.datasets.pipelines import Compose
def disable_text_recog_aug_test(cfg, set_types=None):
"""Remove aug_test from test pipeline of text recognition.
... | 32.162921 | 74 | 0.610655 | import numpy as np
import torch
from mmcv.ops import RoIPool
from mmcv.parallel import collate, scatter
from mmdet.datasets import replace_ImageToTensor
from mmdet.datasets.pipelines import Compose
def disable_text_recog_aug_test(cfg, set_types=None):
assert set_types is None or isinstance(set_types, list)
if... | true | true |
1c009d44cedf7a64045ccd9484b20d02d17e4b4a | 1,568 | py | Python | app/auth/views.py | Carolwanzuu/pitch_app | accd92963cbedb39c53bef5f1851dc11a4ff743a | [
"MIT"
] | null | null | null | app/auth/views.py | Carolwanzuu/pitch_app | accd92963cbedb39c53bef5f1851dc11a4ff743a | [
"MIT"
] | null | null | null | app/auth/views.py | Carolwanzuu/pitch_app | accd92963cbedb39c53bef5f1851dc11a4ff743a | [
"MIT"
] | null | null | null | from flask import render_template,redirect, url_for, flash, request
from ..models import User
from .forms import LoginForm,RegistrationForm
from . import auth
from ..import db
from ..email import mail_message
from flask_login import login_user,logout_user, login_required
@auth.route('/register',methods = ["GET","POST"... | 34.086957 | 105 | 0.697066 | from flask import render_template,redirect, url_for, flash, request
from ..models import User
from .forms import LoginForm,RegistrationForm
from . import auth
from ..import db
from ..email import mail_message
from flask_login import login_user,logout_user, login_required
@auth.route('/register',methods = ["GET","POST"... | true | true |
1c009ddadb1225a92640e704cc9a55652cdc8f58 | 434 | py | Python | UniqueSequencesPlugin.py | movingpictures83/UniqueSequences | f380b9ca105dcf9b4b70e5e2ad27349cbbebe767 | [
"MIT"
] | null | null | null | UniqueSequencesPlugin.py | movingpictures83/UniqueSequences | f380b9ca105dcf9b4b70e5e2ad27349cbbebe767 | [
"MIT"
] | null | null | null | UniqueSequencesPlugin.py | movingpictures83/UniqueSequences | f380b9ca105dcf9b4b70e5e2ad27349cbbebe767 | [
"MIT"
] | null | null | null |
class UniqueSequencesPlugin:
def input(self, filename):
self.fastafile = open(filename, 'r')
def run(self):
self.sequences = set()
lineno = 0
for line in self.fastafile:
if (lineno % 2 == 1):
seq = line.strip()
self.sequences.add(seq)
lineno += 1
def output(self... | 22.842105 | 43 | 0.582949 |
class UniqueSequencesPlugin:
def input(self, filename):
self.fastafile = open(filename, 'r')
def run(self):
self.sequences = set()
lineno = 0
for line in self.fastafile:
if (lineno % 2 == 1):
seq = line.strip()
self.sequences.add(seq)
lineno += 1
def output(self... | true | true |
1c009e175890ebd52e7d34500ff36320af93cdf3 | 13,870 | py | Python | code/utilities/densmore_v3.py | rileydr/SSFC-Data | b9169dfe47c939f4c7a49d9e53e05ba90d066301 | [
"MIT"
] | null | null | null | code/utilities/densmore_v3.py | rileydr/SSFC-Data | b9169dfe47c939f4c7a49d9e53e05ba90d066301 | [
"MIT"
] | null | null | null | code/utilities/densmore_v3.py | rileydr/SSFC-Data | b9169dfe47c939f4c7a49d9e53e05ba90d066301 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.linear_model import LinearRegression, LogisticRegression
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.preprocessing import PolynomialFeatures, StandardScaler
from sklearn.neig... | 45.625 | 124 | 0.478659 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.linear_model import LinearRegression, LogisticRegression
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.preprocessing import PolynomialFeatures, StandardScaler
from sklearn.neig... | true | true |
1c009e6585c9673e375f2e274c7a3b4707df8e2a | 22,225 | py | Python | python/federatedml/protobuf/generated/fm_model_param_pb2.py | showKstage/fut-fate | 77ef6fb84e9f8345aca3dda92ccc63b6a462bc20 | [
"Apache-2.0"
] | 1 | 2021-11-21T06:06:48.000Z | 2021-11-21T06:06:48.000Z | python/federatedml/protobuf/generated/fm_model_param_pb2.py | showKstage/fut-fate | 77ef6fb84e9f8345aca3dda92ccc63b6a462bc20 | [
"Apache-2.0"
] | null | null | null | python/federatedml/protobuf/generated/fm_model_param_pb2.py | showKstage/fut-fate | 77ef6fb84e9f8345aca3dda92ccc63b6a462bc20 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: fm-model-param.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as... | 44.272908 | 2,076 | 0.752441 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _s... | true | true |
1c009ec8cbea771995fa525c36d6027d402e7ea5 | 811 | py | Python | hknweb/events/templatetags/event_filters.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | null | null | null | hknweb/events/templatetags/event_filters.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | null | null | null | hknweb/events/templatetags/event_filters.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | null | null | null | from django import template
import bleach
from django.conf import settings
from pytz import timezone
register = template.Library()
@register.filter
def event_name(name):
return bleach.clean(name, tags=[], strip=True)
@register.filter
def process_event_time(event):
settings_time_zone = timezone(settings.TIM... | 32.44 | 77 | 0.718866 | from django import template
import bleach
from django.conf import settings
from pytz import timezone
register = template.Library()
@register.filter
def event_name(name):
return bleach.clean(name, tags=[], strip=True)
@register.filter
def process_event_time(event):
settings_time_zone = timezone(settings.TIM... | true | true |
1c009fe5e0a7d426fa5acaa019d0e25a51fe3b85 | 5,120 | py | Python | ML Code/NB.py | yemen2016/FakeNewsDetection | 1caad62b068fb125f18c2f35299c36981a86ba55 | [
"MIT"
] | 2 | 2021-09-08T08:46:57.000Z | 2022-03-22T18:30:08.000Z | ML Code/NB.py | yemen2016/FakeNewsDetection | 1caad62b068fb125f18c2f35299c36981a86ba55 | [
"MIT"
] | null | null | null | ML Code/NB.py | yemen2016/FakeNewsDetection | 1caad62b068fb125f18c2f35299c36981a86ba55 | [
"MIT"
] | 1 | 2022-02-02T22:36:41.000Z | 2022-02-02T22:36:41.000Z | from sklearn import model_selection, preprocessing, linear_model, naive_bayes, metrics, svm
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn import decomposition, ensemble
from sklearn.model_selection import cross_validate
import pandas, xgboost, numpy, textblob, string
from ker... | 39.689922 | 124 | 0.759961 | from sklearn import model_selection, preprocessing, linear_model, naive_bayes, metrics, svm
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn import decomposition, ensemble
from sklearn.model_selection import cross_validate
import pandas, xgboost, numpy, textblob, string
from ker... | true | true |
1c00a15be281a74004837d38d5c0d93d90c7936a | 5,083 | py | Python | contacts/tests.py | intherenzone/CRM | d0f3cffed01e5fddfc39c2281b26b2f376b71152 | [
"MIT"
] | 2 | 2018-02-15T15:33:00.000Z | 2018-02-15T16:29:12.000Z | contacts/tests.py | intherenzone/CRM | d0f3cffed01e5fddfc39c2281b26b2f376b71152 | [
"MIT"
] | 1 | 2018-08-31T08:54:22.000Z | 2018-08-31T08:54:22.000Z | contacts/tests.py | intherenzone/CRM | d0f3cffed01e5fddfc39c2281b26b2f376b71152 | [
"MIT"
] | 12 | 2017-11-02T22:32:32.000Z | 2018-04-12T05:13:25.000Z | # from django.test import TestCase
# from contacts.models import Contact
# from accounts.models import Account
# from common.models import Address, Country
# from django.contrib.auth.models import User
# from django.test import Client
# from django.core.urlresolvers import reverse
# class ContactObjectsCreat... | 48.875 | 296 | 0.650207 | true | true | |
1c00a15d2a20e502c478392a0f56e1544855ba79 | 1,172 | py | Python | profiles_api/serializers.py | anandp926/profiles-rest-api | 12583282a7a7c5bd68a5836f081e5c1a05dc4575 | [
"MIT"
] | null | null | null | profiles_api/serializers.py | anandp926/profiles-rest-api | 12583282a7a7c5bd68a5836f081e5c1a05dc4575 | [
"MIT"
] | 5 | 2020-06-06T01:23:52.000Z | 2022-02-10T12:05:31.000Z | profiles_api/serializers.py | anandp926/profiles-rest-api | 12583282a7a7c5bd68a5836f081e5c1a05dc4575 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
"""Serializer a name field for testing"""
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
"""Serializes a user profile object"""
... | 30.842105 | 68 | 0.625427 | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = models.UserProfile
fields = ('id', 'email', 'name', ... | true | true |
1c00a1c0440ea0bf6167050777bc086490797369 | 12,575 | bzl | Python | source/extensions/extensions_build_config.bzl | PinchasLev/envoy | dfbb069d634884e386130dc1b74ef0ff2d4657b0 | [
"Apache-2.0"
] | null | null | null | source/extensions/extensions_build_config.bzl | PinchasLev/envoy | dfbb069d634884e386130dc1b74ef0ff2d4657b0 | [
"Apache-2.0"
] | null | null | null | source/extensions/extensions_build_config.bzl | PinchasLev/envoy | dfbb069d634884e386130dc1b74ef0ff2d4657b0 | [
"Apache-2.0"
] | null | null | null | # See bazel/README.md for details on how this system works.
EXTENSIONS = {
#
# Access loggers
#
"envoy.access_loggers.file": "//source/extensions/access_loggers/file:config",
"envoy.access_loggers.http_grpc": "//source/extensions/access_loggers/http_grpc:con... | 57.159091 | 132 | 0.634672 | EXTENSIONS = {
"envoy.access_loggers.file": "//source/extensions/access_loggers/file:config",
"envoy.access_loggers.http_grpc": "//source/extensions/access_loggers/http_grpc:config",
"envoy.grpc_credentials.file_based_metadata": "//sou... | true | true |
1c00a3ffedbbe2792f809ac9ee2b4e198d870629 | 52,115 | py | Python | ais/ais_msg_3.py | rolker/noaadata | 052a4b7d634e0a3a92a348b543e5db536ae24f02 | [
"Apache-2.0"
] | 35 | 2015-02-15T17:23:00.000Z | 2022-01-27T01:49:43.000Z | ais/ais_msg_3.py | rolker/noaadata | 052a4b7d634e0a3a92a348b543e5db536ae24f02 | [
"Apache-2.0"
] | 2 | 2017-10-04T17:24:38.000Z | 2017-10-04T18:22:00.000Z | ais/ais_msg_3.py | rolker/noaadata | 052a4b7d634e0a3a92a348b543e5db536ae24f02 | [
"Apache-2.0"
] | 22 | 2015-02-08T13:29:58.000Z | 2022-03-09T03:03:16.000Z | #!/usr/bin/env python
"""Python functions to serialize/deserialize binary messages.
Need to then wrap these functions with the outer AIS packet and then
convert the whole binary blob to a NMEA string. Those functions are
not currently provided in this file.
serialize: python to ais binary
deserialize: ais binary to... | 43.429167 | 454 | 0.605584 |
"""Python functions to serialize/deserialize binary messages.
Need to then wrap these functions with the outer AIS packet and then
convert the whole binary blob to a NMEA string. Those functions are
not currently provided in this file.
serialize: python to ais binary
deserialize: ais binary to python
The generated... | false | true |
1c00a4e89376107bc94ee20003f596f7687b3149 | 2,563 | py | Python | swagger-client/python-flask/swagger_server/models/mail_attachment.py | interserver/mailbaby-api-samples | 0879348474e22463e77dc76ba5e5f7e6300a2b6c | [
"MIT"
] | null | null | null | swagger-client/python-flask/swagger_server/models/mail_attachment.py | interserver/mailbaby-api-samples | 0879348474e22463e77dc76ba5e5f7e6300a2b6c | [
"MIT"
] | 185 | 2022-01-01T23:30:37.000Z | 2022-03-25T01:08:22.000Z | swagger-client/python-flask/swagger_server/models/mail_attachment.py | interserver/mailbaby-api-samples | 0879348474e22463e77dc76ba5e5f7e6300a2b6c | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class MailAttachment(Model):
"""NOTE: This class is auto generated by the swag... | 26.978947 | 90 | 0.603199 |
from __future__ import absolute_import
from datetime import date, datetime
from typing import List, Dict
from swagger_server.models.base_model_ import Model
from swagger_server import util
class MailAttachment(Model):
def __init__(self, filename: str=None, data: str=None): self.swagger_types = {
... | true | true |
1c00a4fdd9888ac532297f3d58dbeab3c90747af | 4,523 | py | Python | spot-setup/migrate_to_spot_1_0.py | yellingviv/incubator-spot | b97128edc645be45a09fccdc449cae2fd2225681 | [
"Apache-2.0"
] | 365 | 2016-09-27T22:51:20.000Z | 2022-03-16T07:23:00.000Z | spot-setup/migrate_to_spot_1_0.py | yellingviv/incubator-spot | b97128edc645be45a09fccdc449cae2fd2225681 | [
"Apache-2.0"
] | 155 | 2016-12-13T16:13:27.000Z | 2020-07-13T03:33:29.000Z | spot-setup/migrate_to_spot_1_0.py | yellingviv/incubator-spot | b97128edc645be45a09fccdc449cae2fd2225681 | [
"Apache-2.0"
] | 241 | 2016-11-07T06:07:05.000Z | 2022-01-07T07:40:10.000Z | #!/bin/env python
#
# 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 "Licens... | 43.912621 | 174 | 0.737564 |
import os
import sys
import subprocess
from migration.utilities import util
pipelines = sys.argv[1]
old_oa_path = sys.argv[2]
staging_db = sys.argv[3]
hdfs_staging_path = sys.argv[4]
dest_db = sys.argv[5]
impala_daemon = sys.argv[6]
def main():
log = util.get_logger('SPOT.MIGRATE')
cur_path = os.path.dirname... | true | true |
1c00a516ae83e1d803576e7c3025ddb9134c9e57 | 328 | py | Python | server/scraper.py | JimmyMVP/newsalyser | 4f94396f686aa7a1350868a0876888e9f259595c | [
"Apache-2.0"
] | null | null | null | server/scraper.py | JimmyMVP/newsalyser | 4f94396f686aa7a1350868a0876888e9f259595c | [
"Apache-2.0"
] | null | null | null | server/scraper.py | JimmyMVP/newsalyser | 4f94396f686aa7a1350868a0876888e9f259595c | [
"Apache-2.0"
] | null | null | null | import newspaper
#Returns the urls of the articles in the news sites
def scrape(news_sites=[]):
urlmap = {}
for site in news_sites:
news = newspaper.build(site)
urlmap[site] = []
for article in news.articles:
urlmap[site].append(article.url)
print(urlmap)
return ... | 18.222222 | 51 | 0.625 | import newspaper
def scrape(news_sites=[]):
urlmap = {}
for site in news_sites:
news = newspaper.build(site)
urlmap[site] = []
for article in news.articles:
urlmap[site].append(article.url)
print(urlmap)
return urlmap
| true | true |
1c00a5891e5e90872bc713f8239c14e5c3378b1b | 5,624 | py | Python | tests/test_charge.py | fossabot/MolVS | dc5afca7fcea93ebb0a342b766d70e88d2c0b841 | [
"MIT"
] | 1 | 2019-03-15T03:42:37.000Z | 2019-03-15T03:42:37.000Z | tests/test_charge.py | fossabot/MolVS | dc5afca7fcea93ebb0a342b766d70e88d2c0b841 | [
"MIT"
] | null | null | null | tests/test_charge.py | fossabot/MolVS | dc5afca7fcea93ebb0a342b766d70e88d2c0b841 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for charge.py"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import logging
from rdkit import Chem
from molvs.standardize import Standardizer, standardize_smiles
from molvs.charge import Reionizer... | 35.594937 | 229 | 0.628912 |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import logging
from rdkit import Chem
from molvs.standardize import Standardizer, standardize_smiles
from molvs.charge import Reionizer
logging.basicConfig(level=logging.DEBUG)
def charge_parent_smiles(s... | true | true |
1c00a58d9c87efcdb3b99dec95ec48744acb8d74 | 698 | py | Python | database/information/OPTIMIZER_TRACE.py | mshobair/invitro_cheminformatics | 17201496c73453accd440646a1ee81726119a59c | [
"MIT"
] | null | null | null | database/information/OPTIMIZER_TRACE.py | mshobair/invitro_cheminformatics | 17201496c73453accd440646a1ee81726119a59c | [
"MIT"
] | null | null | null | database/information/OPTIMIZER_TRACE.py | mshobair/invitro_cheminformatics | 17201496c73453accd440646a1ee81726119a59c | [
"MIT"
] | null | null | null | import datetime
from database.database_schemas import Schemas
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime
from sqlalchemy.dialects.mysql import BIGINT, SMALLINT, DOUBLE, TIMESTAMP, TINYINT, LONGTEXT
from database.base import Base
class OptimizerTrace(Base):
"""Maps to OPTIMIZER_TRACE ta... | 36.736842 | 92 | 0.783668 | import datetime
from database.database_schemas import Schemas
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime
from sqlalchemy.dialects.mysql import BIGINT, SMALLINT, DOUBLE, TIMESTAMP, TINYINT, LONGTEXT
from database.base import Base
class OptimizerTrace(Base):
__tablename__ = 'OPTIMIZER_T... | true | true |
1c00a59346f7b494213e10432223d8a4365c2288 | 830 | py | Python | tests/test_mol_cost.py | cambiegroup/aizynthfinder | f5bafb2ac4749284571c05ae6df45b6f45cccd30 | [
"MIT"
] | 2 | 2021-07-16T01:10:29.000Z | 2021-07-16T01:10:35.000Z | tests/test_mol_cost.py | cambiegroup/aizynthfinder | f5bafb2ac4749284571c05ae6df45b6f45cccd30 | [
"MIT"
] | null | null | null | tests/test_mol_cost.py | cambiegroup/aizynthfinder | f5bafb2ac4749284571c05ae6df45b6f45cccd30 | [
"MIT"
] | null | null | null | from aizynthfinder.context.cost import (
ZeroCost,
MoleculeCost,
)
from aizynthfinder.chem import Molecule
def test_zero_cost():
assert ZeroCost()(None) == 0.0
def test_create_mol_cost():
mol = Molecule(smiles="CCCC")
assert MoleculeCost()(mol) == 0.0
def test_mol_cost_cache(mocker):
mol ... | 19.761905 | 64 | 0.683133 | from aizynthfinder.context.cost import (
ZeroCost,
MoleculeCost,
)
from aizynthfinder.chem import Molecule
def test_zero_cost():
assert ZeroCost()(None) == 0.0
def test_create_mol_cost():
mol = Molecule(smiles="CCCC")
assert MoleculeCost()(mol) == 0.0
def test_mol_cost_cache(mocker):
mol ... | true | true |
1c00a5d123689bdf4782dbc003dbac10fe49646d | 1,345 | py | Python | tests/queries/0_stateless/00966_live_view_watch_events_http.py | evryfs/ClickHouse | a9648af0b9e2506ce783106315814ed8dbd0a952 | [
"Apache-2.0"
] | 5 | 2021-05-14T02:46:44.000Z | 2021-11-23T04:58:20.000Z | tests/queries/0_stateless/00966_live_view_watch_events_http.py | evryfs/ClickHouse | a9648af0b9e2506ce783106315814ed8dbd0a952 | [
"Apache-2.0"
] | 13 | 2019-06-06T09:45:53.000Z | 2020-05-15T12:03:45.000Z | tests/queries/0_stateless/00966_live_view_watch_events_http.py | evryfs/ClickHouse | a9648af0b9e2506ce783106315814ed8dbd0a952 | [
"Apache-2.0"
] | 22 | 2019-06-14T10:31:51.000Z | 2020-10-12T14:57:44.000Z | #!/usr/bin/env python3
import os
import sys
CURDIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(CURDIR, 'helpers'))
from client import client, prompt, end_of_block
from httpclient import client as http_client
log = None
# uncomment the line below for debugging
#log=sys.stdout
with c... | 32.02381 | 154 | 0.67658 | import os
import sys
CURDIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(CURDIR, 'helpers'))
from client import client, prompt, end_of_block
from httpclient import client as http_client
log = None
with client(name='client1>', log=log) as client1:
client1.expect(prompt)
clie... | true | true |
1c00a64f1fcbb728f009070d674fbac2bde97506 | 5,403 | py | Python | setup_app/installers/admin_ui.py | qbert2k/jans-setup | 6eef6d945b9b2c56ecc84aa469c59a9fcc091cbd | [
"MIT"
] | 4 | 2020-10-23T19:51:51.000Z | 2021-09-11T10:21:33.000Z | setup_app/installers/admin_ui.py | qbert2k/jans-setup | 6eef6d945b9b2c56ecc84aa469c59a9fcc091cbd | [
"MIT"
] | 120 | 2020-11-26T18:17:18.000Z | 2022-01-12T12:39:38.000Z | setup_app/installers/admin_ui.py | qbert2k/jans-setup | 6eef6d945b9b2c56ecc84aa469c59a9fcc091cbd | [
"MIT"
] | 15 | 2020-10-23T10:43:23.000Z | 2021-11-04T12:38:05.000Z | import os
import time
import glob
import json
import ruamel.yaml
import ldap3
from string import Template
from setup_app import paths
from setup_app.static import AppType, InstallOption, BackendTypes
from setup_app.utils import base
from setup_app.config import Config
from setup_app.utils.setup_utils import SetupUtil... | 44.652893 | 462 | 0.641866 | import os
import time
import glob
import json
import ruamel.yaml
import ldap3
from string import Template
from setup_app import paths
from setup_app.static import AppType, InstallOption, BackendTypes
from setup_app.utils import base
from setup_app.config import Config
from setup_app.utils.setup_utils import SetupUtil... | true | true |
1c00a776b74c6bd4e43378e41429f6111d1b05a4 | 483 | py | Python | dippy/core/models/role.py | eggveloper/dippy.core | 8ad613a50bcbf52132de1ece889e22fa4aba3a44 | [
"MIT"
] | 4 | 2021-04-23T10:26:28.000Z | 2021-08-29T15:34:46.000Z | dippy/core/models/role.py | eggveloper/dippy.core | 8ad613a50bcbf52132de1ece889e22fa4aba3a44 | [
"MIT"
] | 23 | 2021-05-27T13:48:32.000Z | 2021-12-15T15:41:28.000Z | dippy/core/models/role.py | eggveloper/dippy.core | 8ad613a50bcbf52132de1ece889e22fa4aba3a44 | [
"MIT"
] | 7 | 2021-05-22T17:16:57.000Z | 2021-12-15T15:19:12.000Z | from dippy.core.models.model import DippyCoreModel
from dippy.core.snowflake import Snowflake
from typing import Optional
class RoleTagsModel(DippyCoreModel):
bot_id: Optional[Snowflake]
integration_id: Optional[Snowflake]
premium_subscriber: Optional[bool]
class RoleModel(DippyCoreModel):
id: Snowf... | 21.954545 | 50 | 0.745342 | from dippy.core.models.model import DippyCoreModel
from dippy.core.snowflake import Snowflake
from typing import Optional
class RoleTagsModel(DippyCoreModel):
bot_id: Optional[Snowflake]
integration_id: Optional[Snowflake]
premium_subscriber: Optional[bool]
class RoleModel(DippyCoreModel):
id: Snowf... | true | true |
1c00a7a2cca5907dc602a2c55d8b4362cde8091b | 6,140 | py | Python | Algorithms_exercises/exercises/keep/my_NW.py | ilante/programming_immanuela_englander | 45d51c99b09ae335a67e03ac5ea79fc775bdf0bd | [
"MIT"
] | null | null | null | Algorithms_exercises/exercises/keep/my_NW.py | ilante/programming_immanuela_englander | 45d51c99b09ae335a67e03ac5ea79fc775bdf0bd | [
"MIT"
] | null | null | null | Algorithms_exercises/exercises/keep/my_NW.py | ilante/programming_immanuela_englander | 45d51c99b09ae335a67e03ac5ea79fc775bdf0bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed March 04 18:38:20 2020
@author: immanuela
NEEDLEMAN-WUNSCH - Global alignment WITH GAPS
"""
import matrices
def glob_al_NW(seq1, seq2, substitutionMatrix, gap_penalty):
""" Does global alignment employing dynamic programming employing the Needlem... | 49.516129 | 344 | 0.626547 | import matrices
def glob_al_NW(seq1, seq2, substitutionMatrix, gap_penalty):
num_rows = len(seq1) + 1 num_cols = len(seq2) + 1
S = [[0] * num_cols for x in range(num_rows)]
P = [[0] * num_cols for x in range(num_rows)]
for i in range(num_rows):
S[i][0]... | true | true |
1c00a7c97a8899bd19a6dd8c6ac84a3447d3aeda | 6,462 | py | Python | igloo/models/category_series_variable.py | IglooCloud/igloo-python | a1a72db136309dcc85bd0f1bdb6579eb55665855 | [
"MIT"
] | 1 | 2020-10-22T17:25:49.000Z | 2020-10-22T17:25:49.000Z | igloo/models/category_series_variable.py | IglooCloud/igloo-python | a1a72db136309dcc85bd0f1bdb6579eb55665855 | [
"MIT"
] | null | null | null | igloo/models/category_series_variable.py | IglooCloud/igloo-python | a1a72db136309dcc85bd0f1bdb6579eb55665855 | [
"MIT"
] | null | null | null |
from aiodataloader import DataLoader
from igloo.models.utils import wrapWith
class CategorySeriesVariableLoader(DataLoader):
def __init__(self, client, id):
super().__init__()
self.client = client
self._id = id
async def batch_load_fn(self, keys):
fields = " ".join(set(keys))... | 35.505495 | 132 | 0.611111 |
from aiodataloader import DataLoader
from igloo.models.utils import wrapWith
class CategorySeriesVariableLoader(DataLoader):
def __init__(self, client, id):
super().__init__()
self.client = client
self._id = id
async def batch_load_fn(self, keys):
fields = " ".join(set(keys))... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.