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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71525eb6d02c2219a98e137bacd9ff85536c953 | 838 | py | Python | eventmanager/contacts/migrations/0001_initial.py | jasham/event2Backend | 54e9945676458231cacb6fb8ad62a757a9547b63 | [
"MIT"
] | null | null | null | eventmanager/contacts/migrations/0001_initial.py | jasham/event2Backend | 54e9945676458231cacb6fb8ad62a757a9547b63 | [
"MIT"
] | null | null | null | eventmanager/contacts/migrations/0001_initial.py | jasham/event2Backend | 54e9945676458231cacb6fb8ad62a757a9547b63 | [
"MIT"
] | 1 | 2020-04-27T06:45:18.000Z | 2020-04-27T06:45:18.000Z | # Generated by Django 2.2.5 on 2020-03-08 07:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('leads', '__first__'),
]
operations = [
migrations.CreateModel(
... | 31.037037 | 114 | 0.559666 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('leads', '__first__'),
]
operations = [
migrations.CreateModel(
name='Contacts',
fields=[
... | true | true |
f71526b15e9dfaa84b99bbeb8e8827713bb52184 | 38,532 | py | Python | topaz/utils/regexp.py | mswart/topaz | 4bc02d6f4bf29c20f045223ecb6ae8a5cc9df2ae | [
"BSD-3-Clause"
] | null | null | null | topaz/utils/regexp.py | mswart/topaz | 4bc02d6f4bf29c20f045223ecb6ae8a5cc9df2ae | [
"BSD-3-Clause"
] | null | null | null | topaz/utils/regexp.py | mswart/topaz | 4bc02d6f4bf29c20f045223ecb6ae8a5cc9df2ae | [
"BSD-3-Clause"
] | null | null | null | import sys
from rpython.rlib.listsort import make_timsort_class
from rpython.rlib.objectmodel import specialize
from rpython.rlib.rstring import StringBuilder
from rpython.rlib.rsre.rsre_core import (
OPCODE_LITERAL, OPCODE_LITERAL_IGNORE, OPCODE_SUCCESS, OPCODE_ASSERT,
OPCODE_MARK, OPCODE_REPEAT, OPCODE_ANY, ... | 29.190909 | 131 | 0.595116 | import sys
from rpython.rlib.listsort import make_timsort_class
from rpython.rlib.objectmodel import specialize
from rpython.rlib.rstring import StringBuilder
from rpython.rlib.rsre.rsre_core import (
OPCODE_LITERAL, OPCODE_LITERAL_IGNORE, OPCODE_SUCCESS, OPCODE_ASSERT,
OPCODE_MARK, OPCODE_REPEAT, OPCODE_ANY, ... | true | true |
f71526c8cd11306936f07cf05d779b8768da4f48 | 2,661 | py | Python | search_wizard/__init__.py | saptarshibasu15/search-wizard | bd2e84f1f5dbc9196b09ba62930970e364413ed7 | [
"MIT"
] | 2 | 2020-11-26T14:43:45.000Z | 2021-02-15T07:34:45.000Z | search_wizard/__init__.py | saptarshibasu15/search_wizard | bd2e84f1f5dbc9196b09ba62930970e364413ed7 | [
"MIT"
] | null | null | null | search_wizard/__init__.py | saptarshibasu15/search_wizard | bd2e84f1f5dbc9196b09ba62930970e364413ed7 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
import pandas as pd
class SearchWizard:
config = {
"base": "https://www.google.com/search?q=",
"query": None,
"format": "json"
}
search_results = []
def __init__(self, query: str = None):
if not query == None:
... | 34.115385 | 143 | 0.516723 | import requests
from bs4 import BeautifulSoup
import pandas as pd
class SearchWizard:
config = {
"base": "https://www.google.com/search?q=",
"query": None,
"format": "json"
}
search_results = []
def __init__(self, query: str = None):
if not query == None:
... | true | true |
f71526d120aeaf83394faef2c80ab3eeb85fdce7 | 1,413 | py | Python | setup.py | pmrowla/gumiyabot | 5dd446342f129c8e8ddc4de044a7072a58ec7851 | [
"MIT"
] | 4 | 2019-03-19T00:25:44.000Z | 2021-10-16T03:45:22.000Z | setup.py | pmrowla/gumiyabot | 5dd446342f129c8e8ddc4de044a7072a58ec7851 | [
"MIT"
] | 5 | 2017-08-25T15:08:39.000Z | 2021-06-11T09:15:00.000Z | setup.py | pmrowla/gumiyabot | 5dd446342f129c8e8ddc4de044a7072a58ec7851 | [
"MIT"
] | 2 | 2017-10-04T19:30:08.000Z | 2021-12-01T13:39:27.000Z | from setuptools import find_packages, setup
from codecs import open
from os import path
version = '0.1.5'
install_requires = ['aiohttp', 'irc3', 'osuapi']
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='... | 30.717391 | 88 | 0.644728 | from setuptools import find_packages, setup
from codecs import open
from os import path
version = '0.1.5'
install_requires = ['aiohttp', 'irc3', 'osuapi']
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='... | true | true |
f715280a5f0f47e678d78c95f09a2e73a4da4522 | 5,503 | py | Python | src/sentry/web/frontend/accept_organization_invite.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | 1 | 2019-05-28T06:18:03.000Z | 2019-05-28T06:18:03.000Z | src/sentry/web/frontend/accept_organization_invite.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | 6 | 2018-10-19T10:04:23.000Z | 2019-12-09T20:29:12.000Z | src/sentry/web/frontend/accept_organization_invite.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.utils.crypto import constant_time_compare
from django.utils.translation import ugettext_lazy as _
from sentry.models import AuditLogEntryEvent, Authenticator, Or... | 34.39375 | 99 | 0.58459 | from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.utils.crypto import constant_time_compare
from django.utils.translation import ugettext_lazy as _
from sentry.models import AuditLogEntryEvent, Authenticator, Or... | true | true |
f7152815b2e45bf057d62fc81d08199232df205f | 591 | py | Python | wildlifecompliance/migrations/0539_auto_20210317_1151.py | Djandwich/wildlifecompliance | ca296798526a56ce67ffc2f7e8ebdbae95077e6d | [
"Apache-2.0"
] | null | null | null | wildlifecompliance/migrations/0539_auto_20210317_1151.py | Djandwich/wildlifecompliance | ca296798526a56ce67ffc2f7e8ebdbae95077e6d | [
"Apache-2.0"
] | 3 | 2020-03-12T00:45:31.000Z | 2022-03-02T10:37:23.000Z | wildlifecompliance/migrations/0539_auto_20210317_1151.py | Djandwich/wildlifecompliance | ca296798526a56ce67ffc2f7e8ebdbae95077e6d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-03-17 03:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0538_auto_20210305_1140'),
]
operations = [
migratio... | 28.142857 | 172 | 0.637902 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0538_auto_20210305_1140'),
]
operations = [
migrations.AlterField(
model_name='classification',
name='... | true | true |
f71528a738fc1065a84bb466471ea884e98dc377 | 3,768 | py | Python | src/decode/decoder.py | Masao-Someki/CycleVAE_VC | be4a27637a3f8b6272d96105f9b3c9327f6c16f7 | [
"MIT"
] | 3 | 2020-06-03T08:29:49.000Z | 2022-03-23T02:29:01.000Z | src/decode/decoder.py | Masao-Someki/CycleVAE_VC | be4a27637a3f8b6272d96105f9b3c9327f6c16f7 | [
"MIT"
] | 1 | 2020-06-07T23:06:10.000Z | 2020-06-07T23:06:10.000Z | src/decode/decoder.py | Masao-Someki/CycleVAE_VC | be4a27637a3f8b6272d96105f9b3c9327f6c16f7 | [
"MIT"
] | 1 | 2020-06-03T09:41:42.000Z | 2020-06-03T09:41:42.000Z | # Copyright 2020 Masao Someki
# MIT License (https://opensource.org/licenses/MIT)
import os
import glob
import h5py
import logging
import librosa
import numpy as np
from scipy.io import wavfile
from speech import Synthesizer
IRLEN = 1024
INTERVALS = 10
SEED = 1
LP_CUTOFF = 20
class Decoder(object):
def __init... | 31.4 | 97 | 0.52362 | import os
import glob
import h5py
import logging
import librosa
import numpy as np
from scipy.io import wavfile
from speech import Synthesizer
IRLEN = 1024
INTERVALS = 10
SEED = 1
LP_CUTOFF = 20
class Decoder(object):
def __init__(self, args, scaler, logger=None):
self.save_dir = args.exp_dir
... | true | true |
f7152949331934bec0c7d5505f3422644b6d6f4e | 114,228 | gyp | Python | grpc.gyp | stungkit/grpc | 063c36cb46733c13d2ce8116b6af482c9bd832d6 | [
"Apache-2.0"
] | null | null | null | grpc.gyp | stungkit/grpc | 063c36cb46733c13d2ce8116b6af482c9bd832d6 | [
"Apache-2.0"
] | null | null | null | grpc.gyp | stungkit/grpc | 063c36cb46733c13d2ce8116b6af482c9bd832d6 | [
"Apache-2.0"
] | null | null | null | # GRPC GYP build file
# This file has been automatically generated from a template file.
# Please look at the templates directory instead.
# This file can be regenerated from the template by running
# tools/buildgen/generate_projects.sh
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0... | 54.73311 | 135 | 0.684683 |
{
'variables': {
'openssl_gyp_target%': 'Please Define openssl_gyp_target variable',
'zlib_gyp_target%': 'Please Define zlib_gyp_target variable',
'grpc_gcov%': 'false',
'grpc_alpine%': 'false',
},
'target_defaults': {
'configurations': {
'Debug': {
'cflags': [
'-... | true | true |
f715296fb8250e6a9fc65fab4030ce645556e39d | 30,603 | py | Python | tests/httpwrappers/tests.py | ioinfinity/django | b6a0ab523751c13ae3eaec102de70f58f73a0d94 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/httpwrappers/tests.py | ioinfinity/django | b6a0ab523751c13ae3eaec102de70f58f73a0d94 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-07-02T21:10:44.000Z | 2020-07-02T21:11:21.000Z | tests/httpwrappers/tests.py | ioinfinity/django | b6a0ab523751c13ae3eaec102de70f58f73a0d94 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-08-11T18:46:32.000Z | 2020-08-11T18:46:32.000Z | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import copy
import json
import os
import pickle
import unittest
import uuid
from django.core.exceptions import SuspiciousOperation
from django.core.serializers.json import DjangoJSONEncoder
from django.core.signals import request_finished
from django.d... | 38.935115 | 118 | 0.60151 | from __future__ import unicode_literals
import copy
import json
import os
import pickle
import unittest
import uuid
from django.core.exceptions import SuspiciousOperation
from django.core.serializers.json import DjangoJSONEncoder
from django.core.signals import request_finished
from django.db import close_old_connect... | true | true |
f7152c01a06b1a8eea4ae4c08a05e1af35676efc | 82 | py | Python | pyrobolearn/states/generators/__init__.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | 2 | 2021-01-21T21:08:30.000Z | 2022-03-29T16:45:49.000Z | pyrobolearn/states/generators/__init__.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | null | null | null | pyrobolearn/states/generators/__init__.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | 1 | 2020-09-29T21:25:39.000Z | 2020-09-29T21:25:39.000Z | # -*- coding: utf-8 -*-
# import state generators
from .state_generator import *
| 16.4 | 30 | 0.682927 |
from .state_generator import *
| true | true |
f7152cd6c81c021fabfecc053762e195b6af37eb | 493 | py | Python | setup.py | knorth55/chainer-dense-fusion | 8ff53173d7071fc2cfcd05b1e0b2c544aeed090b | [
"MIT"
] | 22 | 2019-01-31T23:50:30.000Z | 2021-09-13T09:41:00.000Z | setup.py | knorth55/chainer-dense-fusion | 8ff53173d7071fc2cfcd05b1e0b2c544aeed090b | [
"MIT"
] | 4 | 2019-07-31T14:40:06.000Z | 2022-03-16T13:32:45.000Z | setup.py | knorth55/chainer-dense-fusion | 8ff53173d7071fc2cfcd05b1e0b2c544aeed090b | [
"MIT"
] | 3 | 2019-08-30T09:18:45.000Z | 2020-03-03T16:07:51.000Z | from setuptools import find_packages
from setuptools import setup
version = '0.0.0'
setup(
name='chainer_dense_fusion',
version=version,
packages=find_packages(),
install_requires=open('requirements.txt').readlines(),
description='',
long_description=open('README.md').read(),
author='Shi... | 23.47619 | 59 | 0.703854 | from setuptools import find_packages
from setuptools import setup
version = '0.0.0'
setup(
name='chainer_dense_fusion',
version=version,
packages=find_packages(),
install_requires=open('requirements.txt').readlines(),
description='',
long_description=open('README.md').read(),
author='Shi... | true | true |
f7152da2720cfd4a357ce9c5b71bde73ceb5bb7b | 2,199 | py | Python | year_2018/day_09.py | gchazot/aoc | 1926114b1060a927be3f87732ba0a399afd98ae4 | [
"MIT"
] | 1 | 2020-04-12T16:14:29.000Z | 2020-04-12T16:14:29.000Z | year_2018/day_09.py | gchazot/aoc | 1926114b1060a927be3f87732ba0a399afd98ae4 | [
"MIT"
] | null | null | null | year_2018/day_09.py | gchazot/aoc | 1926114b1060a927be3f87732ba0a399afd98ae4 | [
"MIT"
] | null | null | null | from __future__ import print_function
import unittest
class TestMarbleGame(unittest.TestCase):
def test_starts_empty(self):
game = MarbleGame(0, 0)
self.assertListEqual([], game.scores)
self.assertListEqual([0], game._circle)
def test_play_examples(self):
def high_score(player... | 34.359375 | 77 | 0.626648 | from __future__ import print_function
import unittest
class TestMarbleGame(unittest.TestCase):
def test_starts_empty(self):
game = MarbleGame(0, 0)
self.assertListEqual([], game.scores)
self.assertListEqual([0], game._circle)
def test_play_examples(self):
def high_score(player... | true | true |
f7152e2178499fecdb9dce8c3f5d9bfbf5c3dfd6 | 297 | py | Python | tests/test_modes.py | s-s-boika/obdlib | 5b0b35276575a522d20858b6993a9bebf0acc968 | [
"MIT"
] | 9 | 2015-07-14T07:15:58.000Z | 2021-06-03T01:42:19.000Z | tests/test_modes.py | s-s-boika/obdlib | 5b0b35276575a522d20858b6993a9bebf0acc968 | [
"MIT"
] | null | null | null | tests/test_modes.py | s-s-boika/obdlib | 5b0b35276575a522d20858b6993a9bebf0acc968 | [
"MIT"
] | 4 | 2015-07-15T09:05:46.000Z | 2022-02-06T04:28:53.000Z | import unittest
import obdlib.obd.modes as modes
class TestModes(unittest.TestCase):
def test_init(self):
m = modes.Modes(1)
self.assertIsInstance(m.modes, dict)
suite = unittest.TestLoader().loadTestsFromTestCase(TestModes)
unittest.TextTestRunner(verbosity=2).run(suite)
| 22.846154 | 62 | 0.747475 | import unittest
import obdlib.obd.modes as modes
class TestModes(unittest.TestCase):
def test_init(self):
m = modes.Modes(1)
self.assertIsInstance(m.modes, dict)
suite = unittest.TestLoader().loadTestsFromTestCase(TestModes)
unittest.TextTestRunner(verbosity=2).run(suite)
| true | true |
f7152e96fcfdafb7945bd56df781ae2d29581903 | 4,319 | py | Python | gbrarscrapy.py | wothard/scrapyfloat | ff0c6698a4732015358ed5e9a07e24dd212eaf7f | [
"MIT"
] | null | null | null | gbrarscrapy.py | wothard/scrapyfloat | ff0c6698a4732015358ed5e9a07e24dd212eaf7f | [
"MIT"
] | null | null | null | gbrarscrapy.py | wothard/scrapyfloat | ff0c6698a4732015358ed5e9a07e24dd212eaf7f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
from lxml import html
import requests
import os
import random
import time
from fake_agent import fakeagent
class Gbrarscrapy(object):
def __init__(self, url_li, proxy_single):
self.title_xpa = '//a[@onmouseover]/text()'
self.score_list_xpa = '//span[@style... | 41.133333 | 249 | 0.508219 |
from lxml import html
import requests
import os
import random
import time
from fake_agent import fakeagent
class Gbrarscrapy(object):
def __init__(self, url_li, proxy_single):
self.title_xpa = '//a[@onmouseover]/text()'
self.score_list_xpa = '//span[@style="color:DarkSlateGray"]/text()'
s... | true | true |
f7152ea08588300b8fbe747412eb41de76a983a8 | 456 | py | Python | experiments/3_parallel_training.py | dddaga/word-tree | ed6c59c16feee04d5c6003b3f5f4df68e6808e04 | [
"MIT"
] | null | null | null | experiments/3_parallel_training.py | dddaga/word-tree | ed6c59c16feee04d5c6003b3f5f4df68e6808e04 | [
"MIT"
] | null | null | null | experiments/3_parallel_training.py | dddaga/word-tree | ed6c59c16feee04d5c6003b3f5f4df68e6808e04 | [
"MIT"
] | 1 | 2020-12-02T09:07:06.000Z | 2020-12-02T09:07:06.000Z | import pymongo
EXPERIMENT_NAME = 'EXP_3'
CORPUS_PATH = 'data/pride_and_prejudice_cleaned.txt'
TRAINING_WINDOW = 3
CONTEXT_DIMENSION = 64
CONTEXT_DECAY = 0.5
CONTRASTIVE_WEIGHT = 0.001
LEANING_RATE = 1
DROPOUT = 0.1
myclient = pymongo.MongoClient('mongodb://localhost:27017')
mydb ... | 14.709677 | 61 | 0.710526 | import pymongo
EXPERIMENT_NAME = 'EXP_3'
CORPUS_PATH = 'data/pride_and_prejudice_cleaned.txt'
TRAINING_WINDOW = 3
CONTEXT_DIMENSION = 64
CONTEXT_DECAY = 0.5
CONTRASTIVE_WEIGHT = 0.001
LEANING_RATE = 1
DROPOUT = 0.1
myclient = pymongo.MongoClient('mongodb://localhost:27017')
mydb ... | true | true |
f7152f1421c03597f5ecc2d6a08acdad363400e1 | 3,893 | py | Python | deprecated/Imputation/GRUI/Run_GAN_imputed.py | srinivasans/DeepSepsis | 8647a2ec93ad5a937638acfc279a756bbfa04f7f | [
"Apache-2.0"
] | 2 | 2019-04-22T07:41:23.000Z | 2019-04-23T02:45:06.000Z | deprecated/Imputation/GRUI/Run_GAN_imputed.py | srinivasans/DeepSepsis | 8647a2ec93ad5a937638acfc279a756bbfa04f7f | [
"Apache-2.0"
] | null | null | null | deprecated/Imputation/GRUI/Run_GAN_imputed.py | srinivasans/DeepSepsis | 8647a2ec93ad5a937638acfc279a756bbfa04f7f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 26 10:47:41 2018
@author: yonghong
"""
from __future__ import print_function
import sys
sys.path.append("..")
import argparse
import os
import tensorflow as tf
from Physionet2019ImputedSepsisData import readImputed
import gru_delta_forGAN
if __name... | 36.046296 | 130 | 0.625995 |
from __future__ import print_function
import sys
sys.path.append("..")
import argparse
import os
import tensorflow as tf
from Physionet2019ImputedSepsisData import readImputed
import gru_delta_forGAN
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='manual to this script')
parser.add_arg... | true | true |
f7152f1b586fbf4b47b2c1084a5b2a3f185a8418 | 340 | py | Python | apps/teams/adminx.py | slyslyme/CTF_AWD_Platform | 6e9eec0a23a316aaf1927d4ec5be923ac26ff21e | [
"MIT"
] | 85 | 2019-04-21T01:38:18.000Z | 2022-03-22T08:06:21.000Z | apps/teams/adminx.py | xuchaoa/CTF_AWD_Platform | b2201f18677939442002e16e64280acd44f72bfe | [
"MIT"
] | 12 | 2019-05-10T14:09:12.000Z | 2022-03-11T23:45:35.000Z | apps/teams/adminx.py | slyslyme/CTF_AWD_Platform | 6e9eec0a23a316aaf1927d4ec5be923ac26ff21e | [
"MIT"
] | 21 | 2019-04-14T16:12:15.000Z | 2022-03-22T08:06:22.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Archerx
# @time: 2019/4/16 上午 11:35
from .models import TeamProfile
import xadmin
class TeamDispaly(object):
list_display = ('id','team_name','team_captain','team_member1','team_member2','team_member3','competition','team_token')
xadmin.site.register(TeamP... | 28.333333 | 124 | 0.729412 |
from .models import TeamProfile
import xadmin
class TeamDispaly(object):
list_display = ('id','team_name','team_captain','team_member1','team_member2','team_member3','competition','team_token')
xadmin.site.register(TeamProfile, TeamDispaly) | true | true |
f7152fae1381c42726a0ec3c4057ea6d2f710ce3 | 3,769 | py | Python | kmip/core/messages/payloads/create.py | vbnmmnbv/PyKMIP | 4617ae528006178c466fe3945a477f568b596940 | [
"Apache-2.0"
] | 12 | 2016-09-14T21:59:10.000Z | 2020-03-11T07:37:25.000Z | kmip/core/messages/payloads/create.py | vbnmmnbv/PyKMIP | 4617ae528006178c466fe3945a477f568b596940 | [
"Apache-2.0"
] | 1 | 2021-06-25T15:43:48.000Z | 2021-06-25T15:43:48.000Z | kmip/core/messages/payloads/create.py | vbnmmnbv/PyKMIP | 4617ae528006178c466fe3945a477f568b596940 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | 32.491379 | 77 | 0.689573 |
from kmip.core import attributes
from kmip.core import enums
from kmip.core.enums import Tags
from kmip.core.objects import TemplateAttribute
from kmip.core.primitives import Struct
from kmip.core.utils import BytearrayStream
class CreateRequestPayload(Struct):
def __init__(self,
object_type... | true | true |
f7152fd92189d41c2d60b2ab2fa4b993a10814c8 | 9,994 | py | Python | torchtext/experimental/datasets/language_modeling.py | NicolasHug/text | 651c1f70ee6e75705aa1c5e4d4cf86ff69b6cbed | [
"BSD-3-Clause"
] | null | null | null | torchtext/experimental/datasets/language_modeling.py | NicolasHug/text | 651c1f70ee6e75705aa1c5e4d4cf86ff69b6cbed | [
"BSD-3-Clause"
] | null | null | null | torchtext/experimental/datasets/language_modeling.py | NicolasHug/text | 651c1f70ee6e75705aa1c5e4d4cf86ff69b6cbed | [
"BSD-3-Clause"
] | null | null | null | import torch
import logging
from torchtext.data.utils import get_tokenizer
from torchtext.vocab import build_vocab_from_iterator
from torchtext.experimental.datasets.raw import language_modeling as raw
from torchtext.experimental.datasets.raw.common import check_default_set
from torchtext.experimental.datasets.raw.comm... | 42.892704 | 111 | 0.662097 | import torch
import logging
from torchtext.data.utils import get_tokenizer
from torchtext.vocab import build_vocab_from_iterator
from torchtext.experimental.datasets.raw import language_modeling as raw
from torchtext.experimental.datasets.raw.common import check_default_set
from torchtext.experimental.datasets.raw.comm... | true | true |
f715303f7cff1a03797169fbe6f8d2773e09ef68 | 925 | py | Python | challenge/urls.py | superdev0505/mtp-web | 8288765a89daaa7b02dfd7e78cc51c4f12d7fcce | [
"MIT"
] | null | null | null | challenge/urls.py | superdev0505/mtp-web | 8288765a89daaa7b02dfd7e78cc51c4f12d7fcce | [
"MIT"
] | null | null | null | challenge/urls.py | superdev0505/mtp-web | 8288765a89daaa7b02dfd7e78cc51c4f12d7fcce | [
"MIT"
] | null | null | null | from django.urls import path, re_path
from . import views
urlpatterns = [
path('', views.index, name='challenge.index'),
path('create', views.challenge_create, name='challenge.challenge_create'),
path('<str:unique_id>/edit/', views.challenge_edit, name='challenge.my_challenge_edit'),
re_path(r'^my-lis... | 57.8125 | 124 | 0.740541 | from django.urls import path, re_path
from . import views
urlpatterns = [
path('', views.index, name='challenge.index'),
path('create', views.challenge_create, name='challenge.challenge_create'),
path('<str:unique_id>/edit/', views.challenge_edit, name='challenge.my_challenge_edit'),
re_path(r'^my-lis... | true | true |
f7153249e54fec334ca1d518b4485c45f6ac4c7a | 693 | py | Python | osiris/vault/__init__.py | skadyan/aws-glue-python-kickstart | 5e3228a0793188d248f801a2b5a522210048ccde | [
"Apache-2.0"
] | 4 | 2020-04-23T18:43:27.000Z | 2022-02-22T03:57:06.000Z | osiris/vault/__init__.py | skadyan/aws-glue-python-kickstart | 5e3228a0793188d248f801a2b5a522210048ccde | [
"Apache-2.0"
] | 1 | 2021-06-02T00:47:12.000Z | 2021-06-02T00:47:12.000Z | osiris/vault/__init__.py | skadyan/aws-glue-python-kickstart | 5e3228a0793188d248f801a2b5a522210048ccde | [
"Apache-2.0"
] | null | null | null | import abc
from abc import abstractmethod
from typing import Union
from osiris.base.generalutils import instantiate
class SecretVault(abc.ABC):
@abstractmethod
def get_secret(self, key: str, attr: str = None, **kwargs) -> Union[dict, str]:
pass
class NoopSecretVault(SecretVault):
def get_secr... | 24.75 | 83 | 0.688312 | import abc
from abc import abstractmethod
from typing import Union
from osiris.base.generalutils import instantiate
class SecretVault(abc.ABC):
@abstractmethod
def get_secret(self, key: str, attr: str = None, **kwargs) -> Union[dict, str]:
pass
class NoopSecretVault(SecretVault):
def get_secr... | true | true |
f71533a0ade4d2a2240d14b32b74a3bbac06db98 | 7,949 | py | Python | i2plib/tunnel.py | undecidedzogvisrainbowvitalispotent-360/i2plib | 6edf51cd5d21cc745aa7e23cb98c582144884fa8 | [
"MIT"
] | 25 | 2018-09-05T16:44:05.000Z | 2022-02-16T18:32:32.000Z | i2plib/tunnel.py | undecidedzogvisvitalispotent8stars360/i2plib | 6edf51cd5d21cc745aa7e23cb98c582144884fa8 | [
"MIT"
] | 2 | 2018-10-24T19:57:16.000Z | 2019-01-26T14:30:40.000Z | i2plib/tunnel.py | undecidedzogvisvitalispotent8stars360/i2plib | 6edf51cd5d21cc745aa7e23cb98c582144884fa8 | [
"MIT"
] | 5 | 2018-10-24T18:01:46.000Z | 2020-12-15T18:16:14.000Z | import logging
import asyncio
import argparse
import i2plib.sam
import i2plib.aiosam
import i2plib.utils
from i2plib.log import logger
BUFFER_SIZE = 65536
async def proxy_data(reader, writer):
"""Proxy data from reader to writer"""
try:
while True:
data = await reader.read(BUFFER_SIZE)
... | 38.965686 | 85 | 0.603472 | import logging
import asyncio
import argparse
import i2plib.sam
import i2plib.aiosam
import i2plib.utils
from i2plib.log import logger
BUFFER_SIZE = 65536
async def proxy_data(reader, writer):
try:
while True:
data = await reader.read(BUFFER_SIZE)
if not data:
bre... | true | true |
f71535405665888b171719de9948f63f35341da0 | 948 | py | Python | dune/gdt/test/linearelliptic/mpi_linearelliptic__block_swipdg_discretization.py | TiKeil/dune-gdt | 25c8b987cc07a4b8b966c1a07ea21b78dba7852f | [
"BSD-2-Clause"
] | null | null | null | dune/gdt/test/linearelliptic/mpi_linearelliptic__block_swipdg_discretization.py | TiKeil/dune-gdt | 25c8b987cc07a4b8b966c1a07ea21b78dba7852f | [
"BSD-2-Clause"
] | null | null | null | dune/gdt/test/linearelliptic/mpi_linearelliptic__block_swipdg_discretization.py | TiKeil/dune-gdt | 25c8b987cc07a4b8b966c1a07ea21b78dba7852f | [
"BSD-2-Clause"
] | null | null | null | # ~~~
# This file is part of the dune-gdt project:
# https://github.com/dune-community/dune-gdt
# Copyright 2010-2018 dune-gdt developers and contributors. All rights reserved.
# License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
# or GPL-2.0+ (http://opensource.org/lic... | 39.5 | 110 | 0.696203 |
import itertools
from dune.xt.codegen import typeid_to_typedef_name, la_backends
grids = ['Yasp2Grid']
casenames = ['ESV2007DdSubdomainsTestCase',]
testcases = ['Dune::GDT::LinearElliptic::{}<{}>'.format(c, g) for c, g in itertools.product(casenames, grids)]
permutations = itertools.product(testcases, ('gdt',), ('i... | true | true |
f715368c12fac7bcd0f0179357f6b421ee70790a | 795 | py | Python | config_music.py | vincenzodentamaro/transformer-xl | 61b76d783be49e409863667bba8576826bbf54df | [
"MIT"
] | 16 | 2020-09-30T02:31:53.000Z | 2022-03-09T10:27:25.000Z | config_music.py | vincenzodentamaro/transformer-xl | 61b76d783be49e409863667bba8576826bbf54df | [
"MIT"
] | 4 | 2020-11-09T03:58:04.000Z | 2021-09-21T09:00:22.000Z | config_music.py | vincenzodentamaro/transformer-xl | 61b76d783be49e409863667bba8576826bbf54df | [
"MIT"
] | 5 | 2020-09-30T02:31:56.000Z | 2021-10-06T15:50:18.000Z | import joblib
tempo = 500000
ppq = 480
numerator = 4
denominator = 4
clocks_per_click = 24
notated_32nd_notes_per_beat = 8
cc_kept = [64, 67]
cc_threshold = 64
cc_lower = 0
cc_upper = 127
vel_value = 64
n_notes = 128
n_cc = 2 * len(cc_kept)
n_sounds = 2 * n_notes + n_cc + 1
n_deltas = 66 + 1
pad_idx = 0
n_jobs... | 14.722222 | 106 | 0.735849 | import joblib
tempo = 500000
ppq = 480
numerator = 4
denominator = 4
clocks_per_click = 24
notated_32nd_notes_per_beat = 8
cc_kept = [64, 67]
cc_threshold = 64
cc_lower = 0
cc_upper = 127
vel_value = 64
n_notes = 128
n_cc = 2 * len(cc_kept)
n_sounds = 2 * n_notes + n_cc + 1
n_deltas = 66 + 1
pad_idx = 0
n_jobs... | true | true |
f715368cd5d00722102b52900d74a1a59b5b3689 | 1,003 | py | Python | loaf/projects/admin.py | Charles4th/Loaf | 1a42fd7c1dc74a90231acfee0d65e235eb586ea3 | [
"MIT"
] | 1 | 2018-12-24T03:30:08.000Z | 2018-12-24T03:30:08.000Z | loaf/projects/admin.py | Charles4th/Loaf | 1a42fd7c1dc74a90231acfee0d65e235eb586ea3 | [
"MIT"
] | 2 | 2020-06-05T18:34:54.000Z | 2022-02-10T11:23:33.000Z | loaf/projects/admin.py | Charles4th/Loaf | 1a42fd7c1dc74a90231acfee0d65e235eb586ea3 | [
"MIT"
] | 1 | 2018-08-07T08:49:28.000Z | 2018-08-07T08:49:28.000Z | from django.contrib import admin
from . import models
# Register your models here.
@admin.register(models.Project)
class ProjectAdmin(admin.ModelAdmin):
list_display_links = (
'title',
)
search_fields = (
'title',
)
list_filter = (
'title',
'creator',
)
... | 17 | 37 | 0.540379 | from django.contrib import admin
from . import models
@admin.register(models.Project)
class ProjectAdmin(admin.ModelAdmin):
list_display_links = (
'title',
)
search_fields = (
'title',
)
list_filter = (
'title',
'creator',
)
list_display = (
... | true | true |
f71537787e6f655fdc91b195e6460f7fc600f783 | 3,800 | py | Python | src/solution/sdc_workspace/catkin_ws/src/sdc_package/scripts/mission_planner.py | coherentsolutionsinc/issoft-insights-2019-sdc-carla-ros | f6d3e162888bd79d59b771c82ff028df0f70ae11 | [
"MIT"
] | 8 | 2019-06-04T16:21:07.000Z | 2021-09-05T07:24:20.000Z | src/solution/sdc_workspace/catkin_ws/src/sdc_package/scripts/mission_planner.py | coherentsolutionsinc/issoft-insights-2019-sdc-carla-ros | f6d3e162888bd79d59b771c82ff028df0f70ae11 | [
"MIT"
] | null | null | null | src/solution/sdc_workspace/catkin_ws/src/sdc_package/scripts/mission_planner.py | coherentsolutionsinc/issoft-insights-2019-sdc-carla-ros | f6d3e162888bd79d59b771c82ff028df0f70ae11 | [
"MIT"
] | 1 | 2019-06-21T14:37:18.000Z | 2019-06-21T14:37:18.000Z | #!/usr/bin/env python
import os
import csv
import rospy
# TODO: 1. Import waypoint messages
from sdc_package.msg import BaseWaypoint, Path
class MissionPlanner(object):
def __init__(self):
self.start_time = None
# TODO: 2. Init mission planner node
rospy.init_node('mission_planner')
... | 40.425532 | 124 | 0.448947 |
import os
import csv
import rospy
from sdc_package.msg import BaseWaypoint, Path
class MissionPlanner(object):
def __init__(self):
self.start_time = None
rospy.init_node('mission_planner')
self.wait_master_initialization()
self.waypoints... | true | true |
f71537954c3bd01d3b1211f2a051aa20670e6f9c | 3,870 | py | Python | run_local_mertric.py | middleprince/fashionAi | c512936b4983c2fb093008f06e04753180af0a90 | [
"Apache-2.0"
] | 316 | 2018-06-01T16:21:21.000Z | 2022-03-22T03:25:20.000Z | run_local_mertric.py | middleprince/fashionAi | c512936b4983c2fb093008f06e04753180af0a90 | [
"Apache-2.0"
] | 8 | 2018-06-02T07:07:49.000Z | 2019-07-11T06:55:43.000Z | run_local_mertric.py | middleprince/fashionAi | c512936b4983c2fb093008f06e04753180af0a90 | [
"Apache-2.0"
] | 91 | 2018-06-01T17:12:21.000Z | 2022-03-19T06:54:34.000Z | import os
import sys
import time
import numpy as np
import pandas as pd
import argparse
import math
import config as cfg
def str2bool(v):
return v.lower() in ("yes", "true", "t", "1")
parser = argparse.ArgumentParser(
description='The Normarlized Error Mertric Calculation For FashionAI Keypoint Detection Scr... | 35.833333 | 148 | 0.582946 | import os
import sys
import time
import numpy as np
import pandas as pd
import argparse
import math
import config as cfg
def str2bool(v):
return v.lower() in ("yes", "true", "t", "1")
parser = argparse.ArgumentParser(
description='The Normarlized Error Mertric Calculation For FashionAI Keypoint Detection Scr... | true | true |
f71538dd1163b1cc57d1780f5f59d458c6767583 | 5,306 | py | Python | examples/plot_SimpleLineTest.py | aasensio/Lightweaver | 9a261e72235f05df548148da140012f40dbd1e4b | [
"MIT"
] | 13 | 2020-01-13T14:01:23.000Z | 2022-03-11T08:36:45.000Z | examples/plot_SimpleLineTest.py | aasensio/Lightweaver | 9a261e72235f05df548148da140012f40dbd1e4b | [
"MIT"
] | 30 | 2020-01-17T13:00:37.000Z | 2022-03-07T12:08:37.000Z | examples/plot_SimpleLineTest.py | aasensio/Lightweaver | 9a261e72235f05df548148da140012f40dbd1e4b | [
"MIT"
] | 4 | 2021-07-07T11:21:07.000Z | 2021-11-23T06:52:02.000Z | """
===============================================================
Computing a simple NLTE 8542 line profile in a FAL C atmosphere
===============================================================
"""
#%%
# First, we import everything we need. Lightweaver is typically imported as
# `lw`, but things like the library of m... | 38.729927 | 85 | 0.671692 | from lightweaver.fal import Falc82
from lightweaver.rh_atoms import H_6_atom, C_atom, O_atom, Si_atom, Al_atom, \
CaII_atom, Fe_atom, He_9_atom, He_atom, MgII_atom, N_atom, Na_atom, S_atom
import lightweaver as lw
import matplotlib.pyplot as plt
import time
import numpy as np
def synth_8542(atmos, conserve, useNe, wa... | true | true |
f7153948cabbb10fc8cd4bd9ce5fe812b7a32534 | 1,921 | py | Python | rme/datasets/mnist.py | satishjasthi/convnet-study | ccd20c90e449fc8db694abf706db178e9413e57b | [
"MIT"
] | 40 | 2016-09-17T00:57:42.000Z | 2021-09-25T05:24:27.000Z | rme/datasets/mnist.py | satishjasthi/convnet-study | ccd20c90e449fc8db694abf706db178e9413e57b | [
"MIT"
] | 1 | 2017-09-08T08:29:31.000Z | 2017-09-13T23:21:09.000Z | rme/datasets/mnist.py | satishjasthi/convnet-study | ccd20c90e449fc8db694abf706db178e9413e57b | [
"MIT"
] | 22 | 2016-11-06T03:57:22.000Z | 2021-09-25T05:24:32.000Z | from __future__ import absolute_import
import os
import numpy as np
import gzip
import struct
from .preprocessing import one_hotify
def load(data_dir, valid_ratio=0.0, one_hot=True, shuffle=False, dtype='float32'):
train_set, valid_set, test_set = {}, {}, {}
# Get data from binary files
for img_set, file_name... | 33.12069 | 82 | 0.630401 | from __future__ import absolute_import
import os
import numpy as np
import gzip
import struct
from .preprocessing import one_hotify
def load(data_dir, valid_ratio=0.0, one_hot=True, shuffle=False, dtype='float32'):
train_set, valid_set, test_set = {}, {}, {}
for img_set, file_name in zip((train_set, test_set)... | true | true |
f7153a02e898f5f116d487d957f85db359c928ad | 5,631 | py | Python | run_preprocessing_oggm.py | Wang518hongyu/PyGEM | 1c9fa133133b3d463b1383d4792c535fa61c5b8d | [
"MIT"
] | null | null | null | run_preprocessing_oggm.py | Wang518hongyu/PyGEM | 1c9fa133133b3d463b1383d4792c535fa61c5b8d | [
"MIT"
] | null | null | null | run_preprocessing_oggm.py | Wang518hongyu/PyGEM | 1c9fa133133b3d463b1383d4792c535fa61c5b8d | [
"MIT"
] | null | null | null | """ PRE-PROCESSING FOR MODEL RUNS USING OGGM """
# Built-in libraries
import argparse
import collections
import inspect
import multiprocessing
import os
import time
# External libraries
import pandas as pd
import pickle
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
# Local libraries
import cl... | 35.866242 | 129 | 0.74818 |
import argparse
import collections
import inspect
import multiprocessing
import os
import time
import pandas as pd
import pickle
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
import class_climate
import pygem.pygem_input as pygem_prms
import pygemfxns_gcmbiasadj as gcmbiasadj
import pygemfxns... | true | true |
f7153a70ee09cafbc4a4a4209f921a512961caf3 | 308 | py | Python | aispace/datasets/tokenizer/__init__.py | SmileGoat/AiSpace | 35fc120667e4263c99b300815e0bf018f5064a40 | [
"Apache-2.0"
] | 32 | 2020-01-16T07:59:03.000Z | 2022-03-31T09:24:00.000Z | aispace/datasets/tokenizer/__init__.py | SmileGoat/AiSpace | 35fc120667e4263c99b300815e0bf018f5064a40 | [
"Apache-2.0"
] | 9 | 2020-06-05T03:27:06.000Z | 2022-03-12T01:00:17.000Z | aispace/datasets/tokenizer/__init__.py | SmileGoat/AiSpace | 35fc120667e4263c99b300815e0bf018f5064a40 | [
"Apache-2.0"
] | 3 | 2020-06-09T02:22:50.000Z | 2021-07-19T06:07:07.000Z | # -*- coding: utf-8 -*-
# @Time : 2019-11-10 16:50
# @Author : yingyuankai
# @Email : yingyuankai@aliyun.com
# @File : __init__.py
from .bert_tokenizer import BertTokenizer
from .tokenizer_base import BaseTokenizer
from .xlnet_tokenizer import XlnetTokenizer
from .gpt_tokenizer import CPMTokenizer | 30.8 | 43 | 0.746753 |
from .bert_tokenizer import BertTokenizer
from .tokenizer_base import BaseTokenizer
from .xlnet_tokenizer import XlnetTokenizer
from .gpt_tokenizer import CPMTokenizer | true | true |
f7153af43ab719b288088a86b292514bb5b4ec0a | 2,233 | py | Python | gcalcli/authorization.py | kdrabek/gcalcli | c05d84ea14a0e85f3689efc6ddd258de33c76e95 | [
"MIT"
] | null | null | null | gcalcli/authorization.py | kdrabek/gcalcli | c05d84ea14a0e85f3689efc6ddd258de33c76e95 | [
"MIT"
] | null | null | null | gcalcli/authorization.py | kdrabek/gcalcli | c05d84ea14a0e85f3689efc6ddd258de33c76e95 | [
"MIT"
] | null | null | null | import json
from pathlib import Path
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import Flow
# set of permissions for particular API
SCOPES = 'https://www.googleapis.com/auth/calendar'
CONFIG_PATH = Path.home() / '.gcalcli'
CREDENTIALS_PATH = CONFIG_PATH / 'credentials.json'
TOKEN... | 27.9125 | 74 | 0.695477 | import json
from pathlib import Path
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import Flow
SCOPES = 'https://www.googleapis.com/auth/calendar'
CONFIG_PATH = Path.home() / '.gcalcli'
CREDENTIALS_PATH = CONFIG_PATH / 'credentials.json'
TOKEN_PATH = CONFIG_PATH / 'token.json'
def... | true | true |
f7153b1e77bb06edb0103c75b470f2e4165017f6 | 4,895 | py | Python | snpdb/views/views_autocomplete.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | snpdb/views/views_autocomplete.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | snpdb/views/views_autocomplete.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | from abc import ABC
from django.contrib.auth.models import User
from django.db.models.functions import Length
from django.db.models.query_utils import Q
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from django.views.decorators.vary import vary_on_cookie
fro... | 37.083333 | 116 | 0.756486 | from abc import ABC
from django.contrib.auth.models import User
from django.db.models.functions import Length
from django.db.models.query_utils import Q
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from django.views.decorators.vary import vary_on_cookie
fro... | true | true |
f7153bf91286bae42e9a55fce4714d6889e21164 | 233 | py | Python | conexao.py | gabrielmonzato20/ProjetoCp | a0d6a3204487d653669284f651c911c09386d626 | [
"Apache-2.0"
] | null | null | null | conexao.py | gabrielmonzato20/ProjetoCp | a0d6a3204487d653669284f651c911c09386d626 | [
"Apache-2.0"
] | null | null | null | conexao.py | gabrielmonzato20/ProjetoCp | a0d6a3204487d653669284f651c911c09386d626 | [
"Apache-2.0"
] | 1 | 2018-09-19T12:28:08.000Z | 2018-09-19T12:28:08.000Z | def mensagem():
print('Criando no python')
def tabuada():
n = int(input('Digite um número que deseja ver a tabuada: '))
for x in range (1,11):
print('{} X {:2} = {:2}'.format(n, x, n*x))
mensagem()
tabuada()
| 21.181818 | 65 | 0.562232 | def mensagem():
print('Criando no python')
def tabuada():
n = int(input('Digite um número que deseja ver a tabuada: '))
for x in range (1,11):
print('{} X {:2} = {:2}'.format(n, x, n*x))
mensagem()
tabuada()
| true | true |
f7153c21736cca53d92914b2228e578ffc94a1f1 | 13,114 | py | Python | projects/g3h1-cp-fml-interpreter/src/lexer/dfa.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/lexer/dfa.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/lexer/dfa.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | from enum import unique, Enum
class DFA:
def __init__(self, source_data):
if type(source_data) != dict:
raise TypeError('第 1 个参数期望 {arg_type_expect} 类型,却接收到类型 {arg_type} '.format(
arg_type_expect='dict', arg_type=str(type(source_data))
))
if type(source_da... | 34.970667 | 108 | 0.416959 | from enum import unique, Enum
class DFA:
def __init__(self, source_data):
if type(source_data) != dict:
raise TypeError('第 1 个参数期望 {arg_type_expect} 类型,却接收到类型 {arg_type} '.format(
arg_type_expect='dict', arg_type=str(type(source_data))
))
if type(source_da... | true | true |
f7153c4f5db58c6522a6d97004d7dcdde2bcc24c | 262 | py | Python | src/core/migrations/0050_merge_20190212_0720.py | metabolism-of-cities/ARCHIVED-metabolism-of-cities-platform-v3 | c754d3b1b401906a21640b8eacb6b724a448b31c | [
"MIT"
] | null | null | null | src/core/migrations/0050_merge_20190212_0720.py | metabolism-of-cities/ARCHIVED-metabolism-of-cities-platform-v3 | c754d3b1b401906a21640b8eacb6b724a448b31c | [
"MIT"
] | null | null | null | src/core/migrations/0050_merge_20190212_0720.py | metabolism-of-cities/ARCHIVED-metabolism-of-cities-platform-v3 | c754d3b1b401906a21640b8eacb6b724a448b31c | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2019-02-12 07:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0049_merge_20190212_0544'),
('core', '0049_article_head'),
]
operations = [
]
| 17.466667 | 47 | 0.633588 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0049_merge_20190212_0544'),
('core', '0049_article_head'),
]
operations = [
]
| true | true |
f7153d3e5f303fac4afc1dc66b303035bd382d50 | 969 | py | Python | doc/api/epydoc/build.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | doc/api/epydoc/build.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | 1 | 2020-10-29T12:01:38.000Z | 2022-03-21T02:39:59.000Z | doc/api/epydoc/build.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
'''
Epydoc API Runner
------------------
Using pkg_resources, we attempt to see if epydoc is installed,
if so, we use its cli program to compile the documents
'''
try:
import sys, os, shutil
import pkg_resources
pkg_resources.require("epydoc")
from epydoc.cli import cli
sys.... | 24.846154 | 62 | 0.603715 | try:
import sys, os, shutil
import pkg_resources
pkg_resources.require("epydoc")
from epydoc.cli import cli
sys.argv = '''epydoc.py pymodbus
--html --simple-term --quiet
--include-log
--graph=all
--docformat=plaintext
--debug
--exclude=._
--ex... | true | true |
f7153e68784e7eb11f5fe8da4e684247486b27ce | 58,002 | py | Python | Source/ThirdParty/gyp/pylib/gyp/generator/msvs.py | VincentWei/mdolphin-core | 48ffdcf587a48a7bb4345ae469a45c5b64ffad0e | [
"Apache-2.0"
] | 6 | 2017-05-31T01:46:45.000Z | 2018-06-12T10:53:30.000Z | WebKit/Source/ThirdParty/gyp/pylib/gyp/generator/msvs.py | JavaScriptTesting/LJS | 9818dbdb421036569fff93124ac2385d45d01c3a | [
"Apache-2.0"
] | null | null | null | WebKit/Source/ThirdParty/gyp/pylib/gyp/generator/msvs.py | JavaScriptTesting/LJS | 9818dbdb421036569fff93124ac2385d45d01c3a | [
"Apache-2.0"
] | 2 | 2017-07-17T06:02:42.000Z | 2018-09-19T10:08:38.000Z | #!/usr/bin/python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ntpath
import posixpath
import os
import re
import subprocess
import sys
import gyp.MSVSNew as MSVSNew
import gyp.MSVSProject as MSVSPro... | 37.614786 | 137 | 0.685063 |
import ntpath
import posixpath
import os
import re
import subprocess
import sys
import gyp.MSVSNew as MSVSNew
import gyp.MSVSProject as MSVSProject
import gyp.MSVSToolFile as MSVSToolFile
import gyp.MSVSUserFile as MSVSUserFile
import gyp.MSVSVersion as MSVSVersion
import gyp.MSVSSettings as MSVSSettings
import gyp.... | false | true |
f7153eb3b8319ab7b8fbdefb6c2a256421b0226c | 256 | py | Python | submissions/joi2012yo/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/joi2012yo/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/joi2012yo/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
p = min([int(readline()) for _ in range(3)])
g = min([int(readline()) for _ in range(2)])
print(p + g - 50)
| 25.6 | 44 | 0.699219 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
p = min([int(readline()) for _ in range(3)])
g = min([int(readline()) for _ in range(2)])
print(p + g - 50)
| true | true |
f7153eeb0752afecb51dc681dd7cab991cb43202 | 1,722 | py | Python | Model.py | Giorgiobientinesi/Workshop2 | f454499d4befdb705b4672be25d8698ef2b37116 | [
"MIT"
] | null | null | null | Model.py | Giorgiobientinesi/Workshop2 | f454499d4befdb705b4672be25d8698ef2b37116 | [
"MIT"
] | null | null | null | Model.py | Giorgiobientinesi/Workshop2 | f454499d4befdb705b4672be25d8698ef2b37116 | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn.preprocessing import OneHotEncoder
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_absolute_error
df = pd.read_csv("Airbnb-cleaned.csv")
df.columns
del df["Unnamed: 0"]
df1 = df[['neighbourhood',... | 31.309091 | 91 | 0.702091 | import pandas as pd
from sklearn.preprocessing import OneHotEncoder
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_absolute_error
df = pd.read_csv("Airbnb-cleaned.csv")
df.columns
del df["Unnamed: 0"]
df1 = df[['neighbourhood',... | true | true |
f7153f357c7a65ac30f9f3d65e5017cda2f97c38 | 1,185 | py | Python | scrython/rulings/arena.py | vtbassmatt/Scrython | 49fd9bd112e0f552a4310ac81fdb3f2b9e2a3976 | [
"MIT"
] | null | null | null | scrython/rulings/arena.py | vtbassmatt/Scrython | 49fd9bd112e0f552a4310ac81fdb3f2b9e2a3976 | [
"MIT"
] | null | null | null | scrython/rulings/arena.py | vtbassmatt/Scrython | 49fd9bd112e0f552a4310ac81fdb3f2b9e2a3976 | [
"MIT"
] | null | null | null | from .rulings_object import RulingsObject
class Arena(RulingsObject):
"""
cards/mtgo/:id/rulings
Gets the ruling of a card by the Arena Id.
Args:
id (string): The arena id of the card you want rulings for.
format (string, optional): Returns data in the specified method. Defaults to JS... | 33.857143 | 129 | 0.62616 | from .rulings_object import RulingsObject
class Arena(RulingsObject):
def __init__(self, **kwargs):
if kwargs.get('id') is None:
raise TypeError('No id provided to search by')
self.url = 'cards/arena/{}/rulings?'.format(str(kwargs.get('id')))
super(Arena, self).__init__(self.ur... | true | true |
f715404495e00bc2fc41e3195c1aac56c832e314 | 2,319 | py | Python | survos2/improc/regions/ccl.py | DiamondLightSource/SuRVoS2 | 42bacfb6a5cc267f38ca1337e51a443eae1a9d2b | [
"MIT"
] | 4 | 2017-10-10T14:47:16.000Z | 2022-01-14T05:57:50.000Z | survos2/improc/regions/ccl.py | DiamondLightSource/SuRVoS2 | 42bacfb6a5cc267f38ca1337e51a443eae1a9d2b | [
"MIT"
] | 1 | 2022-01-11T21:11:12.000Z | 2022-01-12T08:22:34.000Z | survos2/improc/regions/ccl.py | DiamondLightSource/SuRVoS2 | 42bacfb6a5cc267f38ca1337e51a443eae1a9d2b | [
"MIT"
] | 2 | 2018-03-06T06:31:29.000Z | 2019-03-04T03:33:18.000Z | import logging
import os.path as op
import numpy as np
import pycuda.driver as cuda
import pycuda.gpuarray as gpuarray
import pycuda.autoinit
from pycuda.compiler import SourceModule
from ..improc_types import int3
from ..utils import gpuregion, cpuregion
from ..cuda import asgpuarray, grid_kernel_conf... | 29.35443 | 88 | 0.675722 | import logging
import os.path as op
import numpy as np
import pycuda.driver as cuda
import pycuda.gpuarray as gpuarray
import pycuda.autoinit
from pycuda.compiler import SourceModule
from ..improc_types import int3
from ..utils import gpuregion, cpuregion
from ..cuda import asgpuarray, grid_kernel_conf... | true | true |
f71540c4bd66f93fc57f13dd1acee11e0731db26 | 1,753 | py | Python | fyle/platform/platform.py | fylein/fyle-platform-sdk-py | dcf0f1de25e95e41ec213dc97c09196203090d01 | [
"MIT"
] | 1 | 2022-03-08T09:43:30.000Z | 2022-03-08T09:43:30.000Z | fyle/platform/platform.py | fylein/fyle-platform-sdk-py | dcf0f1de25e95e41ec213dc97c09196203090d01 | [
"MIT"
] | 2 | 2021-11-22T09:12:12.000Z | 2022-03-17T10:13:40.000Z | fyle/platform/platform.py | fylein/fyle-platform-sdk-py | dcf0f1de25e95e41ec213dc97c09196203090d01 | [
"MIT"
] | null | null | null | """
Fyle Platform SDK Class
"""
from .apis import v1beta
from .globals.config import config
from .internals.auth import Auth
class Platform(Auth):
"""The main class which creates a connection with
Fyle APIs using OAuth2 authentication (refresh token grant type).
Parameters:
client_id (str): ... | 27.390625 | 87 | 0.64575 |
from .apis import v1beta
from .globals.config import config
from .internals.auth import Auth
class Platform(Auth):
def __init__(self, server_url, token_url, client_id, client_secret, refresh_token):
super().__init__()
self.__server_url = server_url
self.__token_url = token_url
... | true | true |
f7154188c1409f7ad80c6acf7c69384da06e644f | 4,384 | py | Python | jobChomper/graph.py | bhautikj/jobChomper | 09b50b3e14ab580a93376e4882214c18a8da34d5 | [
"MIT"
] | 1 | 2018-03-16T03:16:49.000Z | 2018-03-16T03:16:49.000Z | jobChomper/graph.py | bhautikj/jobChomper | 09b50b3e14ab580a93376e4882214c18a8da34d5 | [
"MIT"
] | null | null | null | jobChomper/graph.py | bhautikj/jobChomper | 09b50b3e14ab580a93376e4882214c18a8da34d5 | [
"MIT"
] | null | null | null | ##
## Weirdo Tree Graph that powers jobChomper
## --
##
## Assertions:
## * DAG is made up of named edges
## * Each edge is a triple (A, B, NEEDSPREVIOUSTOPASS)
## A, B are the named nodes
## B will execute after A has evaluated
## NEEDSPREVIOUSTOPASS is True or False; if it is True then A _must_ eval... | 28.842105 | 107 | 0.580748 | ## * Comment lines in graph file start with #
## * Elements in graph lines separated by ',' - for example:
## A, B, True
##
import jobChomper.node
import logging
STARTNODENAME = "STARTNODE"
RUNONLYONPASS = "onlyOnPass"
RUNONFAIL = "onFail"
def findCycle(graph):
todo = set(graph.keys())
while todo:
nod... | true | true |
f715418cf642bd95568448dcaef9e2cf8c16dcc4 | 1,446 | py | Python | tests/00_unit/test_base.py | wolcomm/eos-prefix-list-agent | a1ec37494048f0f0524ca5ff985838d844c84e4e | [
"MIT"
] | 8 | 2019-06-02T23:47:38.000Z | 2021-08-24T07:30:08.000Z | tests/00_unit/test_base.py | wolcomm/eos-prefix-list-agent | a1ec37494048f0f0524ca5ff985838d844c84e4e | [
"MIT"
] | 39 | 2019-04-09T06:21:56.000Z | 2022-01-29T10:00:37.000Z | tests/00_unit/test_base.py | wolcomm/eos-prefix-list-agent | a1ec37494048f0f0524ca5ff985838d844c84e4e | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are licensed under the MIT License
# (the "License"); you may not use this file except in compliance with the
# License.
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | 37.076923 | 79 | 0.69018 |
from __future__ import print_function
import pytest
from prefix_list_agent.base import PrefixListBase
class TestPrefixListAgent(object):
def test_init(self, sdk, mocker):
mocker.patch("eossdk.Tracer", autospec=True)
base = PrefixListBase()
assert isinstance(base, PrefixListBase)
@... | true | true |
f71541e82fcb35f2b0c32b4abe7a90cb5afb6096 | 4,982 | py | Python | homeassistant/components/august/gateway.py | bg1000/core | 4ee4d674d8931927eae5222e3bf8dd6e26f3c6e5 | [
"Apache-2.0"
] | 1 | 2021-03-20T12:25:26.000Z | 2021-03-20T12:25:26.000Z | homeassistant/components/august/gateway.py | bg1000/core | 4ee4d674d8931927eae5222e3bf8dd6e26f3c6e5 | [
"Apache-2.0"
] | 51 | 2020-08-03T07:30:44.000Z | 2022-03-22T06:02:42.000Z | homeassistant/components/august/gateway.py | bg1000/core | 4ee4d674d8931927eae5222e3bf8dd6e26f3c6e5 | [
"Apache-2.0"
] | null | null | null | """Handle August connection setup and authentication."""
import asyncio
import logging
import os
from aiohttp import ClientError, ClientResponseError
from august.api_async import ApiAsync
from august.authenticator_async import AuthenticationState, AuthenticatorAsync
from homeassistant.const import (
CONF_PASSWOR... | 34.839161 | 110 | 0.66399 |
import asyncio
import logging
import os
from aiohttp import ClientError, ClientResponseError
from august.api_async import ApiAsync
from august.authenticator_async import AuthenticationState, AuthenticatorAsync
from homeassistant.const import (
CONF_PASSWORD,
CONF_TIMEOUT,
CONF_USERNAME,
HTTP_UNAUTHOR... | true | true |
f715431153040fc9d72aca7e7a4ab69f64467305 | 8,101 | py | Python | mv_gaussian/low_dim_w_summary_stats/run_script_snpla.py | SamuelWiqvist/snpla | 9d586c5d09de3eecd2536485af6fc28a915443e4 | [
"MIT"
] | 2 | 2021-02-17T14:13:54.000Z | 2021-06-01T08:29:35.000Z | mv_gaussian/low_dim_w_summary_stats/run_script_snpla.py | SamuelWiqvist/snpla | 9d586c5d09de3eecd2536485af6fc28a915443e4 | [
"MIT"
] | null | null | null | mv_gaussian/low_dim_w_summary_stats/run_script_snpla.py | SamuelWiqvist/snpla | 9d586c5d09de3eecd2536485af6fc28a915443e4 | [
"MIT"
] | null | null | null | # Imports
import sys
import torch
import os
import time
import numpy as np
from torch.distributions.multivariate_normal import MultivariateNormal
# Initial set up
lunarc = int(sys.argv[1])
dim = int(sys.argv[2])
seed = int(sys.argv[3])
seed_data = int(sys.argv[4])
hp_tuning = int(sys.argv[5]) # if hp_tuning = 0, no h... | 33.754167 | 125 | 0.627453 | import sys
import torch
import os
import time
import numpy as np
from torch.distributions.multivariate_normal import MultivariateNormal
lunarc = int(sys.argv[1])
dim = int(sys.argv[2])
seed = int(sys.argv[3])
seed_data = int(sys.argv[4])
hp_tuning = int(sys.argv[5]) lambda_val = float(sys.argv[6])
print("Input args... | true | true |
f715435ca91863f52909480c8b9b5ef1a9fa028f | 3,048 | py | Python | alipay/aop/api/domain/AlipayUserCertDocIDCard.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserCertDocIDCard.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserCertDocIDCard.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserCertDocIDCard(object):
def __init__(self):
self._encoded_img_emblem = None
self._encoded_img_identity = None
self._expire_date = None
self.... | 30.178218 | 91 | 0.607612 | import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserCertDocIDCard(object):
def __init__(self):
self._encoded_img_emblem = None
self._encoded_img_identity = None
self._expire_date = None
self._name = None
self._number = None
... | true | true |
f71543f1283b285219a186f659bb0b4f1109d5be | 387 | py | Python | boost/inception/migrations/0006_auto_20190723_1445.py | igorMIA/bus_com_parser | 07de65f3106c302d96b5fd9dad89562de44ec63f | [
"MIT"
] | null | null | null | boost/inception/migrations/0006_auto_20190723_1445.py | igorMIA/bus_com_parser | 07de65f3106c302d96b5fd9dad89562de44ec63f | [
"MIT"
] | 12 | 2020-02-12T01:09:12.000Z | 2022-03-11T23:54:05.000Z | boost/inception/migrations/0006_auto_20190723_1445.py | igorMIA/bus_com_parser | 07de65f3106c302d96b5fd9dad89562de44ec63f | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-07-23 14:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inception', '0005_auto_20190723_0810'),
]
operations = [
migrations.AlterField(
model_name='busstation',
name='cost'... | 20.368421 | 49 | 0.599483 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inception', '0005_auto_20190723_0810'),
]
operations = [
migrations.AlterField(
model_name='busstation',
name='cost',
field=models.FloatField(null=True)... | true | true |
f715452e7dcf6d35a6ee975f8b79b14024d1e44c | 1,053 | py | Python | ProjectEulerPython/problems/problem_039.py | geo-desic/project-euler | 8065ee082a6948447ef961c9aa960c90a815a3ab | [
"MIT"
] | null | null | null | ProjectEulerPython/problems/problem_039.py | geo-desic/project-euler | 8065ee082a6948447ef961c9aa960c90a815a3ab | [
"MIT"
] | null | null | null | ProjectEulerPython/problems/problem_039.py | geo-desic/project-euler | 8065ee082a6948447ef961c9aa960c90a815a3ab | [
"MIT"
] | null | null | null | from problems.problem import Problem
def generate_pythagorean_triples(ub: int) -> []:
# https://en.wikipedia.org/wiki/Pythagorean_triple
result = []
for a in range(1, ub):
aa = a * a
b = a + 1
c = b + 1
while c <= ub:
cc = aa + b * b
while c * c < cc:
c += 1
if c * c == ... | 27 | 69 | 0.576448 | from problems.problem import Problem
def generate_pythagorean_triples(ub: int) -> []:
result = []
for a in range(1, ub):
aa = a * a
b = a + 1
c = b + 1
while c <= ub:
cc = aa + b * b
while c * c < cc:
c += 1
if c * c == cc and c <= ub:
result.append([a + b + c, a... | true | true |
f71545a38ac9fb407c64619685ddb0408292df6d | 10,791 | py | Python | maskgen/batch/validate_from_s3.py | spongezhang/maskgen | 7284e300d1cb326a5349879de0bace9cfa8788a8 | [
"BSD-3-Clause"
] | null | null | null | maskgen/batch/validate_from_s3.py | spongezhang/maskgen | 7284e300d1cb326a5349879de0bace9cfa8788a8 | [
"BSD-3-Clause"
] | null | null | null | maskgen/batch/validate_from_s3.py | spongezhang/maskgen | 7284e300d1cb326a5349879de0bace9cfa8788a8 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import os
import maskgen.scenario_model
from maskgen.tool_set import *
from maskgen import video_tools
import tempfile
from maskgen.scenario_model import ImageProjectModel
from maskgen.image_graph import extract_archive
from maskgen.graph_rules import processProjectProperties
from maskgen.batch import B... | 39.097826 | 126 | 0.624317 | import argparse
import os
import maskgen.scenario_model
from maskgen.tool_set import *
from maskgen import video_tools
import tempfile
from maskgen.scenario_model import ImageProjectModel
from maskgen.image_graph import extract_archive
from maskgen.graph_rules import processProjectProperties
from maskgen.batch import B... | false | true |
f7154628c62314b11aa471a6abfc977dd15376a2 | 1,130 | py | Python | scripts/install_nightly.py | xylar/cdat | 8a5080cb18febfde365efc96147e25f51494a2bf | [
"BSD-3-Clause"
] | 62 | 2018-03-30T15:46:56.000Z | 2021-12-08T23:30:24.000Z | scripts/install_nightly.py | xylar/cdat | 8a5080cb18febfde365efc96147e25f51494a2bf | [
"BSD-3-Clause"
] | 114 | 2018-03-21T01:12:43.000Z | 2021-07-05T12:29:54.000Z | scripts/install_nightly.py | CDAT/uvcdat | 5133560c0c049b5c93ee321ba0af494253b44f91 | [
"BSD-3-Clause"
] | 14 | 2018-06-06T02:42:47.000Z | 2021-11-26T03:27:00.000Z | import sys
import os
import argparse
this_dir = os.path.abspath(os.path.dirname(__file__))
modules_dir = os.path.join(this_dir, '..', 'modules')
sys.path.append(modules_dir)
from Const import *
from Util import *
from CondaUtils import *
from CDATSetupUtils import *
valid_py_vers = PYTHON_VERSIONS
parser = argparse... | 23.061224 | 88 | 0.7 | import sys
import os
import argparse
this_dir = os.path.abspath(os.path.dirname(__file__))
modules_dir = os.path.join(this_dir, '..', 'modules')
sys.path.append(modules_dir)
from Const import *
from Util import *
from CondaUtils import *
from CDATSetupUtils import *
valid_py_vers = PYTHON_VERSIONS
parser = argparse... | true | true |
f715466767fcc3856809b3d312d0e597406be25b | 1,717 | py | Python | model/summaries.py | victor-estrade/SystGradDescent | 822e7094290301ec47a99433381a8d6406798aff | [
"MIT"
] | 2 | 2019-03-20T09:05:02.000Z | 2019-03-20T15:23:44.000Z | model/summaries.py | victor-estrade/SystGradDescent | 822e7094290301ec47a99433381a8d6406798aff | [
"MIT"
] | null | null | null | model/summaries.py | victor-estrade/SystGradDescent | 822e7094290301ec47a99433381a8d6406798aff | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
DEFAULT_N_BINS = 10
def compute_summaries(clf, X, W, n_bins=DEFAULT_N_BINS):
proba = clf.predict_proba(X)
count, _ = np.histo... | 30.122807 | 90 | 0.610367 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
DEFAULT_N_BINS = 10
def compute_summaries(clf, X, W, n_bins=DEFAULT_N_BINS):
proba = clf.predict_proba(X)
count, _ = np.histogram(proba[:, 1]... | true | true |
f71546b9ddaa47e3907f339c6e8a2f21aac12fe0 | 1,566 | py | Python | 14_Modulos_e_pacotes/ex110/moeda.py | TheCarvalho/Curso-Em-Video-Python | 8bd5128023ddf8b0f59eab46463c95e47569da73 | [
"Unlicense"
] | null | null | null | 14_Modulos_e_pacotes/ex110/moeda.py | TheCarvalho/Curso-Em-Video-Python | 8bd5128023ddf8b0f59eab46463c95e47569da73 | [
"Unlicense"
] | null | null | null | 14_Modulos_e_pacotes/ex110/moeda.py | TheCarvalho/Curso-Em-Video-Python | 8bd5128023ddf8b0f59eab46463c95e47569da73 | [
"Unlicense"
] | null | null | null | def metade(valor=0, formato=False):
res = valor/2
return res if formato is False else moeda(res)
def dobro(valor=0, formato=False):
res = valor*2
return res if formato is False else moeda(res)
def aumentar(valor=0, porcentagem=0, formato=False):
res = valor+(valor * porcentagem/100)
return r... | 31.32 | 101 | 0.650064 | def metade(valor=0, formato=False):
res = valor/2
return res if formato is False else moeda(res)
def dobro(valor=0, formato=False):
res = valor*2
return res if formato is False else moeda(res)
def aumentar(valor=0, porcentagem=0, formato=False):
res = valor+(valor * porcentagem/100)
return r... | true | true |
f71548f4a246b57a8868bfef6d1910128b7621d9 | 4,245 | py | Python | tools/ci_build/op_registration_validator.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 669 | 2018-12-03T22:00:31.000Z | 2019-05-06T19:42:49.000Z | tools/ci_build/op_registration_validator.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 440 | 2018-12-03T21:09:56.000Z | 2019-05-06T20:47:23.000Z | tools/ci_build/op_registration_validator.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 140 | 2018-12-03T21:15:28.000Z | 2019-05-06T18:02:36.000Z | # !/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""
Validate ORT kernel registrations.
"""
import argparse
import os
import sys
import typing
import op_registration_utils
from logger import get_logger
log = get_logger("op_registration_validator")
... | 36.594828 | 117 | 0.659128 |
import argparse
import os
import sys
import typing
import op_registration_utils
from logger import get_logger
log = get_logger("op_registration_validator")
deprecated_ops = {
"kOnnxDomain:Scatter": 11,
"kOnnxDomain:Upsample": 10,
"kOnnxDomain:MeanVarianceNormalization": 9,
"kOnnxDoma... | true | true |
f7154930de7d5ffc6f439d636c13d83d490d8d16 | 1,853 | py | Python | src/users/models/microsoftgraphcalendar_permission.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | src/users/models/microsoftgraphcalendar_permission.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | src/users/models/microsoftgraphcalendar_permission.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 39.425532 | 131 | 0.622774 |
from msrest.serialization import Model
class MicrosoftgraphcalendarPermission(Model):
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'email_address': {'key': 'emailAddress', 'type': 'MicrosoftgraphemailAddress'},
'is_removable': {'key': 'isRemovable', 'type': 'bool'},
'is... | true | true |
f7154c78addf3f568945d3b47a10b93101d1a781 | 4,877 | py | Python | xadmin/plugins/passwords.py | jneight/django-xadmin | d5fca423e3ae10e3ca086e5ae9ea7068872f0a29 | [
"BSD-3-Clause"
] | null | null | null | xadmin/plugins/passwords.py | jneight/django-xadmin | d5fca423e3ae10e3ca086e5ae9ea7068872f0a29 | [
"BSD-3-Clause"
] | null | null | null | xadmin/plugins/passwords.py | jneight/django-xadmin | d5fca423e3ae10e3ca086e5ae9ea7068872f0a29 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
from django.contrib.auth.tokens import default_token_generator
from django.contrib.auth.views import password_reset_confirm
from django.template.response import TemplateResponse
from django.utils.translation import ugettext as _
fr... | 42.408696 | 183 | 0.710478 | from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
from django.contrib.auth.tokens import default_token_generator
from django.contrib.auth.views import password_reset_confirm
from django.template.response import TemplateResponse
from django.utils.translation import ugettext as _
from xadmin.sites... | true | true |
f7154e6ded9574e14e9389f664090a3155de4514 | 18,588 | py | Python | Lib/idlelib/idle_test/test_pyparse.py | fongchinghinunsw/cpython | 19926d058dc33856631c6c6b3fcb45b04fcab666 | [
"CNRI-Python-GPL-Compatible"
] | 120 | 2019-11-12T19:22:44.000Z | 2020-05-17T12:17:25.000Z | Lib/idlelib/idle_test/test_pyparse.py | fongchinghinunsw/cpython | 19926d058dc33856631c6c6b3fcb45b04fcab666 | [
"CNRI-Python-GPL-Compatible"
] | 19 | 2021-02-18T05:59:03.000Z | 2022-01-13T01:00:52.000Z | Lib/idlelib/idle_test/test_pyparse.py | fongchinghinunsw/cpython | 19926d058dc33856631c6c6b3fcb45b04fcab666 | [
"CNRI-Python-GPL-Compatible"
] | 18 | 2021-02-22T13:32:56.000Z | 2022-01-22T12:38:29.000Z | "Test pyparse, coverage 96%."
from idlelib import pyparse
import unittest
from collections import namedtuple
class ParseMapTest(unittest.TestCase):
def test_parsemap(self):
keepwhite = {ord(c): ord(c) for c in ' \t\n\r'}
mapping = pyparse.ParseMap(keepwhite)
self.assertEqual(mapping[ord(... | 39.802998 | 84 | 0.48074 |
from idlelib import pyparse
import unittest
from collections import namedtuple
class ParseMapTest(unittest.TestCase):
def test_parsemap(self):
keepwhite = {ord(c): ord(c) for c in ' \t\n\r'}
mapping = pyparse.ParseMap(keepwhite)
self.assertEqual(mapping[ord('\t')], ord('\t'))
sel... | true | true |
f715502ca425f6aa72c39448be881ca66c5df2be | 1,703 | py | Python | game.py | zty111/tonghua | 71b0ecc857f72ab9bb7882358c15587117cdcd6a | [
"MIT"
] | null | null | null | game.py | zty111/tonghua | 71b0ecc857f72ab9bb7882358c15587117cdcd6a | [
"MIT"
] | null | null | null | game.py | zty111/tonghua | 71b0ecc857f72ab9bb7882358c15587117cdcd6a | [
"MIT"
] | null | null | null | from keras.saving.save import load_model
from board import GameState, Player
from encoder import Encoder
from agent import Agent
import scoring
from board import Move, Point
from tiaocan import bot_name
class My():
def select_move(self, game_state):
print("请输入点坐标和方向(或弃权):")
x, y, d = input().split(... | 28.864407 | 99 | 0.664709 | from keras.saving.save import load_model
from board import GameState, Player
from encoder import Encoder
from agent import Agent
import scoring
from board import Move, Point
from tiaocan import bot_name
class My():
def select_move(self, game_state):
print("请输入点坐标和方向(或弃权):")
x, y, d = input().split(... | true | true |
f715517d413224bd0e232c087a3dc3de8fac5148 | 2,409 | py | Python | DATA/10_64_64_64_1E7/analy.py | Aieener/SUS_3D | 8fc5a768a2339238939522baf96bce98bf61902e | [
"MIT"
] | null | null | null | DATA/10_64_64_64_1E7/analy.py | Aieener/SUS_3D | 8fc5a768a2339238939522baf96bce98bf61902e | [
"MIT"
] | null | null | null | DATA/10_64_64_64_1E7/analy.py | Aieener/SUS_3D | 8fc5a768a2339238939522baf96bce98bf61902e | [
"MIT"
] | null | null | null | # analy.py
# A python program to analyze the SUS weighting function in order to reach the following goals:
# 1. plot the weight function
# 2. generate the normalized distribution for Z=1
# 3. extrapolate the N distribution for different Zs given by the user.
# Author: Yuding Ai
# Date: 2015 Oct 23
import math
import n... | 23.38835 | 95 | 0.632213 |
import math
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
def PN():
WF = [] PN = []
with open("SUSWeight_function.txt","r") as file:
for line in file:
words = line.split(... | true | true |
f71552f33127dfdd46d5834de303cbaed5612835 | 1,326 | py | Python | asset/lambda/index.py | jialechan/cdk-elasticache-monitor | 584d1f583e934e32d80f1abea7fdc100c226b348 | [
"Apache-2.0"
] | 1 | 2020-07-27T09:15:41.000Z | 2020-07-27T09:15:41.000Z | asset/lambda/index.py | jialechan/cdk-elasticache-monitor | 584d1f583e934e32d80f1abea7fdc100c226b348 | [
"Apache-2.0"
] | 509 | 2020-08-04T07:02:41.000Z | 2022-03-28T15:05:51.000Z | asset/lambda/index.py | jialechan/cdk-elasticache-monitor | 584d1f583e934e32d80f1abea7fdc100c226b348 | [
"Apache-2.0"
] | 1 | 2020-08-28T01:13:15.000Z | 2020-08-28T01:13:15.000Z | import os
import json
import time
import urllib.parse
import urllib.request
def handler(event, context):
"""
alarm to slack
"""
print(json.dumps(event))
slack_webhook_url = os.environ['SLACK_WEBHOOK_URL']
channel = os.environ['CHANNEL']
username = os.environ['USERNAME']
icon_emoji = ... | 28.826087 | 100 | 0.585973 | import os
import json
import time
import urllib.parse
import urllib.request
def handler(event, context):
print(json.dumps(event))
slack_webhook_url = os.environ['SLACK_WEBHOOK_URL']
channel = os.environ['CHANNEL']
username = os.environ['USERNAME']
icon_emoji = os.environ['ICON_EMOJI']
for r... | true | true |
f715530ab61caacad8fa0ce7435869a1c5c114aa | 417 | py | Python | codestorm_e_learning/asgi.py | Sahiladiv/PSST_CSHTN-08 | 0cd4a5b27f16d17a410b1e7cd2596038925f7070 | [
"MIT"
] | null | null | null | codestorm_e_learning/asgi.py | Sahiladiv/PSST_CSHTN-08 | 0cd4a5b27f16d17a410b1e7cd2596038925f7070 | [
"MIT"
] | null | null | null | codestorm_e_learning/asgi.py | Sahiladiv/PSST_CSHTN-08 | 0cd4a5b27f16d17a410b1e7cd2596038925f7070 | [
"MIT"
] | null | null | null | """
ASGI config for codestorm_e_learning project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault(... | 24.529412 | 80 | 0.798561 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'codestorm_e_learning.settings')
application = get_asgi_application()
| true | true |
f71553a353729b9fcc5938672ff20758e7d08a89 | 1,886 | py | Python | ramjet/data_interface/tess_eclipsing_binary_metadata_manager.py | golmschenk/ramjet | 77fb4481a15088923308fda09804d80455d1a9cf | [
"Apache-2.0"
] | 3 | 2020-11-23T18:47:37.000Z | 2021-08-05T17:45:51.000Z | ramjet/data_interface/tess_eclipsing_binary_metadata_manager.py | golmschenk/ramjet | 77fb4481a15088923308fda09804d80455d1a9cf | [
"Apache-2.0"
] | 5 | 2021-08-19T00:54:57.000Z | 2022-02-10T00:15:40.000Z | ramjet/data_interface/tess_eclipsing_binary_metadata_manager.py | golmschenk/ramjet | 77fb4481a15088923308fda09804d80455d1a9cf | [
"Apache-2.0"
] | 3 | 2019-07-12T21:00:57.000Z | 2020-06-03T22:18:13.000Z | """
Code for managing the TESS eclipsing binary metadata.
"""
import pandas as pd
from pathlib import Path
from peewee import IntegerField, SchemaManager
from ramjet.data_interface.metadatabase import MetadatabaseModel, metadatabase
brian_powell_eclipsing_binary_csv_path = Path('data/tess_eclipsing_binaries/TESS_EB_... | 34.925926 | 105 | 0.696713 | import pandas as pd
from pathlib import Path
from peewee import IntegerField, SchemaManager
from ramjet.data_interface.metadatabase import MetadatabaseModel, metadatabase
brian_powell_eclipsing_binary_csv_path = Path('data/tess_eclipsing_binaries/TESS_EB_catalog_23Jun.csv')
class TessEclipsingBinaryMetadata(Metada... | true | true |
f715544b39ad2bd0403cdd0c656584e7498e39cb | 508 | py | Python | instagram_profile/settings.py | barseghyanartur/django-instagram-profile | 1bb36551114d26e7c75f0ddf8f79db68fc02101e | [
"BSD-3-Clause"
] | 1 | 2020-12-03T22:01:27.000Z | 2020-12-03T22:01:27.000Z | instagram_profile/settings.py | barseghyanartur/django-instagram-profile | 1bb36551114d26e7c75f0ddf8f79db68fc02101e | [
"BSD-3-Clause"
] | null | null | null | instagram_profile/settings.py | barseghyanartur/django-instagram-profile | 1bb36551114d26e7c75f0ddf8f79db68fc02101e | [
"BSD-3-Clause"
] | null | null | null | from configparser import RawConfigParser
from django.conf import settings
env = RawConfigParser()
env.read(settings.BASE_DIR + '/env.ini')
INSTAGRAM_ACCOUNT = env['instagram']['account']
INSTAGRAM_AUTH_URL = env['instagram']['auth_url']
INSTAGRAM_ACCESS_TOKEN_URL = env['instagram']['access_token_url']
INSTAGRAM_APP_... | 33.866667 | 65 | 0.775591 | from configparser import RawConfigParser
from django.conf import settings
env = RawConfigParser()
env.read(settings.BASE_DIR + '/env.ini')
INSTAGRAM_ACCOUNT = env['instagram']['account']
INSTAGRAM_AUTH_URL = env['instagram']['auth_url']
INSTAGRAM_ACCESS_TOKEN_URL = env['instagram']['access_token_url']
INSTAGRAM_APP_... | true | true |
f7155533198f2d3d8e3cde89ddd32d5f3fb20652 | 3,413 | py | Python | extra/convert_all.py | Goten87/BLPConverter | a4baed2b76b0c23e28e4ac9066b2823304f4b498 | [
"MIT"
] | null | null | null | extra/convert_all.py | Goten87/BLPConverter | a4baed2b76b0c23e28e4ac9066b2823304f4b498 | [
"MIT"
] | null | null | null | extra/convert_all.py | Goten87/BLPConverter | a4baed2b76b0c23e28e4ac9066b2823304f4b498 | [
"MIT"
] | null | null | null | #! /usr/bin/env python2
import os
import sys
import subprocess
import select
from optparse import OptionParser
# Setup of the command-line arguments parser
text = "Usage: %prog [options] <root-folder>\n\nConvert (in-place) all the BLP files in <root-folder> and its subdirectories"
parser = OptionParser(text, version... | 34.474747 | 185 | 0.607091 |
import os
import sys
import subprocess
import select
from optparse import OptionParser
text = "Usage: %prog [options] <root-folder>\n\nConvert (in-place) all the BLP files in <root-folder> and its subdirectories"
parser = OptionParser(text, version="%prog 1.0")
parser.add_option("--converter", action="store", defaul... | false | true |
f715555b72413c60a579b8d7d74d37a54ae765af | 1,832 | py | Python | sorting/merge-sort-recursive.py | thehimalayanleo/Algorithm-Practice | aa63d90de7a3a72910ead1017574e2cca485009f | [
"MIT"
] | null | null | null | sorting/merge-sort-recursive.py | thehimalayanleo/Algorithm-Practice | aa63d90de7a3a72910ead1017574e2cca485009f | [
"MIT"
] | null | null | null | sorting/merge-sort-recursive.py | thehimalayanleo/Algorithm-Practice | aa63d90de7a3a72910ead1017574e2cca485009f | [
"MIT"
] | null | null | null | ## A recursive implementation of merge sort.
## Author: AJ
## test case 1 45 849 904 79 48942 7
class sorting:
def __init__(self):
self.arr = []
def get_data(self):
self.arr = list(map(int, input().split()))
return self.arr
def merge_sort(self, array):
if len(array) == 1:
... | 29.548387 | 74 | 0.554039 |
class sorting:
def __init__(self):
self.arr = []
def get_data(self):
self.arr = list(map(int, input().split()))
return self.arr
def merge_sort(self, array):
if len(array) == 1:
return array
mid = len(array)//2 left = self.merge_sort(arra... | true | true |
f71555608a70f602ee61e7b668ed75d79fe49531 | 2,393 | py | Python | pynmodl/tests/parsing/test_scoping.py | tjbanks/pynmodl | b7d6bb378711ce19cd651561c08146e3571d986a | [
"MIT"
] | 9 | 2017-06-03T19:33:46.000Z | 2019-10-27T22:19:37.000Z | pynmodl/tests/parsing/test_scoping.py | tjbanks/pynmodl | b7d6bb378711ce19cd651561c08146e3571d986a | [
"MIT"
] | 11 | 2017-10-13T16:09:10.000Z | 2019-05-08T16:37:11.000Z | pynmodl/tests/parsing/test_scoping.py | tjbanks/pynmodl | b7d6bb378711ce19cd651561c08146e3571d986a | [
"MIT"
] | 2 | 2017-08-29T14:29:45.000Z | 2019-12-31T19:45:02.000Z | import os
from textx.metamodel import metamodel_from_file
from textx.model import children_of_type
from pynmodl.nmodl import NModlCompiler
mm = metamodel_from_file(
os.path.join(os.path.dirname(__file__), '../../grammar/nmodl.tx'))
mm.register_obj_processors({'VarRef': NModlCompiler().handle_varref})
def refs_in... | 26.588889 | 70 | 0.55328 | import os
from textx.metamodel import metamodel_from_file
from textx.model import children_of_type
from pynmodl.nmodl import NModlCompiler
mm = metamodel_from_file(
os.path.join(os.path.dirname(__file__), '../../grammar/nmodl.tx'))
mm.register_obj_processors({'VarRef': NModlCompiler().handle_varref})
def refs_in... | true | true |
f715558281aaabbc79dcce8d745a1065f13cec44 | 27,919 | py | Python | chalice/cli/__init__.py | sw33tr0ll/chalice | 8c48771ef0fe2ae97a00e337ca5828e709b132d3 | [
"Apache-2.0"
] | 1 | 2020-12-19T07:34:28.000Z | 2020-12-19T07:34:28.000Z | chalice/cli/__init__.py | sw33tr0ll/chalice | 8c48771ef0fe2ae97a00e337ca5828e709b132d3 | [
"Apache-2.0"
] | 1 | 2020-12-20T21:08:52.000Z | 2020-12-20T21:08:52.000Z | chalice/cli/__init__.py | sw33tr0ll/chalice | 8c48771ef0fe2ae97a00e337ca5828e709b132d3 | [
"Apache-2.0"
] | null | null | null | """Command line interface for chalice.
Contains commands for deploying chalice.
"""
import logging
import os
import platform
import sys
import tempfile
import shutil
import traceback
import functools
import json
import botocore.exceptions
import click
from typing import Dict, Any, Optional, cast # noqa
from chalic... | 41.732436 | 79 | 0.647767 | import logging
import os
import platform
import sys
import tempfile
import shutil
import traceback
import functools
import json
import botocore.exceptions
import click
from typing import Dict, Any, Optional, cast
from chalice import __version__ as chalice_version
from chalice.app import Chalice from chalice.awsclie... | true | true |
f715566e418c809bc95f0d6c57bc79a0f14a15b4 | 1,920 | py | Python | nanobox_libcloud/tasks/azure_arm.py | mu-box/nanobox-adapter-libcloud | a8606799a4899c3e771f24467b61cc09a49f0d55 | [
"MIT"
] | 4 | 2017-08-26T16:26:02.000Z | 2017-11-10T02:20:32.000Z | nanobox_libcloud/tasks/azure_arm.py | mu-box/nanobox-adapter-libcloud | a8606799a4899c3e771f24467b61cc09a49f0d55 | [
"MIT"
] | 9 | 2017-09-12T20:26:07.000Z | 2019-04-01T18:08:28.000Z | nanobox_libcloud/tasks/azure_arm.py | mu-box/nanobox-adapter-libcloud | a8606799a4899c3e771f24467b61cc09a49f0d55 | [
"MIT"
] | 7 | 2017-09-16T09:00:48.000Z | 2021-03-01T04:28:39.000Z | from nanobox_libcloud import celery
from nanobox_libcloud import adapters
from time import sleep
import logging
@celery.task
def azure_destroy_arm(creds, name):
logger = logging.getLogger(__name__)
self = adapters.azure_arm.AzureARM()
driver = self._get_user_driver(**creds)
logger.info('Destroying se... | 36.226415 | 80 | 0.519792 | from nanobox_libcloud import celery
from nanobox_libcloud import adapters
from time import sleep
import logging
@celery.task
def azure_destroy_arm(creds, name):
logger = logging.getLogger(__name__)
self = adapters.azure_arm.AzureARM()
driver = self._get_user_driver(**creds)
logger.info('Destroying se... | true | true |
f715567b1c04fc53d84059088a5b453d461d55e7 | 1,293 | py | Python | airbyte-integrations/connectors/source-hubspot/main_dev.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-03-02T09:17:41.000Z | 2021-03-02T11:02:23.000Z | airbyte-integrations/connectors/source-hubspot/main_dev.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 52 | 2021-06-11T12:39:05.000Z | 2022-03-30T04:59:35.000Z | airbyte-integrations/connectors/source-hubspot/main_dev.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-12-14T17:15:40.000Z | 2021-12-14T17:18:03.000Z | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | 38.029412 | 80 | 0.771075 |
import sys
from base_python.entrypoint import launch
from source_hubspot import SourceHubspot
if __name__ == "__main__":
source = SourceHubspot()
launch(source, sys.argv[1:])
| true | true |
f7155888da8319908c50672d71d366b286e97a8a | 8,907 | py | Python | apis/nb/clients/inventory_manager_client/models/LicenseInfoDTO.py | CiscoDevNet/APIC-EM-Generic-Scripts- | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 45 | 2016-06-09T15:41:25.000Z | 2019-08-06T17:13:11.000Z | apis/nb/clients/inventory_manager_client/models/LicenseInfoDTO.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 36 | 2016-06-12T03:03:56.000Z | 2017-03-13T18:20:11.000Z | apis/nb/clients/inventory_manager_client/models/LicenseInfoDTO.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2016-06-22T03:51:37.000Z | 2019-07-10T10:06:02.000Z | #!/usr/bin/env python
#pylint: skip-file
# This source code is licensed under the Apache license found in the
# LICENSE file in the root directory of this project.
class LicenseInfoDTO(object):
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the v... | 27.072948 | 145 | 0.461659 |
class LicenseInfoDTO(object):
def __init__(self):
self.swaggerTypes = {
'name': 'str',
'priority': 'str',
'type': 'str',
'description': 'str',
... | true | true |
f715593dca93c7ea7889b286ec0ff7c88525f4e6 | 6,383 | py | Python | flowvision/models/style_transfer/stylenet.py | Oneflow-Inc/vision | 352e9240f63118112ea174bb2d0b502fa54be16f | [
"BSD-3-Clause"
] | 40 | 2021-10-19T02:34:56.000Z | 2022-03-25T07:49:44.000Z | flowvision/models/style_transfer/stylenet.py | Oneflow-Inc/vision | 352e9240f63118112ea174bb2d0b502fa54be16f | [
"BSD-3-Clause"
] | 53 | 2021-10-22T02:24:44.000Z | 2022-03-31T04:20:47.000Z | flowvision/models/style_transfer/stylenet.py | Oneflow-Inc/vision | 352e9240f63118112ea174bb2d0b502fa54be16f | [
"BSD-3-Clause"
] | 11 | 2022-01-06T02:57:07.000Z | 2022-03-23T15:19:51.000Z | """
Modified from https://github.com/Oneflow-Inc/models/blob/main/Vision/style_transform/fast_neural_style/neural_style/transformer_net.py
"""
from typing import Any
import oneflow as flow
from ..registry import ModelCreator
from ..utils import load_state_dict_from_url
__all__ = ["FastNeuralStyle", "fast_neural_sty... | 39.159509 | 186 | 0.675858 | from typing import Any
import oneflow as flow
from ..registry import ModelCreator
from ..utils import load_state_dict_from_url
__all__ = ["FastNeuralStyle", "fast_neural_style"]
style_model_urls = {
"sketch": "https://oneflow-public.oss-cn-beijing.aliyuncs.com/model_zoo/flowvision/neural_style_transfer/sketch... | true | true |
f71559ccbf89d77b0fb702498ba29b015dc7c215 | 3,597 | py | Python | examples/pytorch/nlp/huggingface_models/common/tests/test_tokenization_small_blenderbot.py | huggingface/neural-compressor | aaad4c357a86914ffa583753c9a26d949838a2a5 | [
"Apache-2.0"
] | 172 | 2021-09-14T18:34:17.000Z | 2022-03-30T06:49:53.000Z | examples/pytorch/nlp/huggingface_models/common/tests/test_tokenization_small_blenderbot.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 40 | 2021-09-14T02:26:12.000Z | 2022-03-29T08:34:04.000Z | examples/pytorch/nlp/huggingface_models/common/tests/test_tokenization_small_blenderbot.py | intel/neural-compressor | 16a4a12045fcb468da4d33769aff2c1a5e2ba6ba | [
"Apache-2.0"
] | 33 | 2021-09-15T07:27:25.000Z | 2022-03-25T08:30:57.000Z | #!/usr/bin/env python3
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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/LICENS... | 41.344828 | 108 | 0.687517 | import json
import os
import unittest
from transformers.models.blenderbot_small.tokenization_blenderbot_small import (
VOCAB_FILES_NAMES,
BlenderbotSmallTokenizer,
)
from .test_tokenization_common import TokenizerTesterMixin
class BlenderbotSmallTokenizerTest(TokenizerTesterMixin, unittest.TestCase):
t... | true | true |
f71559da0abd1737aa33927ca6ae4d82a909ed60 | 1,426 | py | Python | enable-s3-encryption.py | thilinajayanath/s3-server-side-encryption | b1de6cc2785825df0c6f6769ff0693edd5d2e5f6 | [
"MIT"
] | null | null | null | enable-s3-encryption.py | thilinajayanath/s3-server-side-encryption | b1de6cc2785825df0c6f6769ff0693edd5d2e5f6 | [
"MIT"
] | null | null | null | enable-s3-encryption.py | thilinajayanath/s3-server-side-encryption | b1de6cc2785825df0c6f6769ff0693edd5d2e5f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import boto3
from botocore.exceptions import ClientError
parser = argparse.ArgumentParser(description='Check all S3 buckets in the AWS account and enables default encryption with AES256')
parser.add_argument('aws_account_name', type=str, help='Named AWS user account')
args = pa... | 36.564103 | 170 | 0.718093 |
import argparse
import boto3
from botocore.exceptions import ClientError
parser = argparse.ArgumentParser(description='Check all S3 buckets in the AWS account and enables default encryption with AES256')
parser.add_argument('aws_account_name', type=str, help='Named AWS user account')
args = parser.parse_args()
sess... | true | true |
f7155a0bc67e529b57bf0704543609089406c58a | 1,557 | py | Python | a1/__init__.py | o-ran-sc/ric-plt-a1 | 902771612ffcf0541ea27dce35eb6f20bf885cf3 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | a1/__init__.py | o-ran-sc/ric-plt-a1 | 902771612ffcf0541ea27dce35eb6f20bf885cf3 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | a1/__init__.py | o-ran-sc/ric-plt-a1 | 902771612ffcf0541ea27dce35eb6f20bf885cf3 | [
"Apache-2.0",
"CC-BY-4.0"
] | 3 | 2020-05-24T05:51:03.000Z | 2021-08-23T07:21:49.000Z | # ==================================================================================
# Copyright (c) 2019 Nokia
# Copyright (c) 2018-2019 AT&T Intellectual Property.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 42.081081 | 84 | 0.659602 | import connexion
from prometheus_client import CollectorRegistry, generate_latest, multiprocess
app = connexion.App(__name__, specification_dir=".")
app.add_api("openapi.yaml", arguments={"title": "My Title"})
@app.app.route('/a1-p/metrics', methods=['GET'])
def metrics(): # hence it's added here in the cr... | true | true |
f7155a5748b43f2a16ce87a6c062feb7b20551ab | 234 | py | Python | cieloApi3/__init__.py | thiagosm/API-3.0-Python | 2fab59d5e0ce7191d3c458e8fab9b1d3c6298748 | [
"MIT"
] | null | null | null | cieloApi3/__init__.py | thiagosm/API-3.0-Python | 2fab59d5e0ce7191d3c458e8fab9b1d3c6298748 | [
"MIT"
] | null | null | null | cieloApi3/__init__.py | thiagosm/API-3.0-Python | 2fab59d5e0ce7191d3c458e8fab9b1d3c6298748 | [
"MIT"
] | null | null | null | from .environment import *
from .merchant import *
from .sale import *
from .customer import *
from .creditCard import *
from .debitCard import *
from .payment import *
from .recurrentPayment import *
from .cieloEcommerce import *
| 18 | 31 | 0.75641 | from .environment import *
from .merchant import *
from .sale import *
from .customer import *
from .creditCard import *
from .debitCard import *
from .payment import *
from .recurrentPayment import *
from .cieloEcommerce import *
| true | true |
f7155a7ee909d8a5c4d0f88e8722b5abeabb44e3 | 13,929 | py | Python | google/ads/google_ads/v3/proto/services/asset_service_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v3/proto/services/asset_service_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v3/proto/services/asset_service_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2020-09-30T17:04:06.000Z | 2020-09-30T17:04:06.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v3/proto/services/asset_service.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... | 41.332344 | 1,840 | 0.77414 |
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 |
f7155b122a1e35ce2adb4b96a2aadaade4b5777f | 567 | py | Python | center/app/playback/parsers/ip_parser.py | netSensTeam/netSens | 7ab5f41a7103e6c86aa6cb2eff3df68c301e48c1 | [
"MIT"
] | null | null | null | center/app/playback/parsers/ip_parser.py | netSensTeam/netSens | 7ab5f41a7103e6c86aa6cb2eff3df68c301e48c1 | [
"MIT"
] | 3 | 2021-05-10T13:50:55.000Z | 2022-03-02T08:12:46.000Z | center/app/playback/parsers/ip_parser.py | netSensTeam/netSens | 7ab5f41a7103e6c86aa6cb2eff3df68c301e48c1 | [
"MIT"
] | null | null | null | import dpkt
from parsers.utils import *
name = 'ip_parser'
def parseFunc(ts, eth):
if getMACString(eth.dst) == 'FF:FF:FF:FF:FF:FF':
return None
if isinstance(eth.data, dpkt.ip.IP):
return parseIPPacket(ts, eth)
def parseIPPacket(ts, eth):
ip = eth.data
tpa = getIPString(ip.dst)
t... | 21.807692 | 59 | 0.527337 | import dpkt
from parsers.utils import *
name = 'ip_parser'
def parseFunc(ts, eth):
if getMACString(eth.dst) == 'FF:FF:FF:FF:FF:FF':
return None
if isinstance(eth.data, dpkt.ip.IP):
return parseIPPacket(ts, eth)
def parseIPPacket(ts, eth):
ip = eth.data
tpa = getIPString(ip.dst)
t... | true | true |
f7155c6b7863bc6529f4f6f16e61fb8e883beed8 | 6,035 | py | Python | pandas_study/PandasTest.py | BreezeDawn/numpy-pandas-matplotlib- | e55dccb2442e57c2fccb2081966a7c19e731083a | [
"MIT"
] | null | null | null | pandas_study/PandasTest.py | BreezeDawn/numpy-pandas-matplotlib- | e55dccb2442e57c2fccb2081966a7c19e731083a | [
"MIT"
] | null | null | null | pandas_study/PandasTest.py | BreezeDawn/numpy-pandas-matplotlib- | e55dccb2442e57c2fccb2081966a7c19e731083a | [
"MIT"
] | 1 | 2018-10-24T07:33:51.000Z | 2018-10-24T07:33:51.000Z | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def base():
index = pd.date_range('20181023', periods=9) # 生成9个行索引
column = ['a', 'b', 'c', 'd'] # 生成4个列索引
a = np.random.randn(9, 4) # 随便生成的9行4列的数据
df = pd.DataFrame(a, index=index, columns=column)
print(df)
print(pd.Dat... | 35.922619 | 136 | 0.566031 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def base():
index = pd.date_range('20181023', periods=9) column = ['a', 'b', 'c', 'd'] a = np.random.randn(9, 4) df = pd.DataFrame(a, index=index, columns=column)
print(df)
print(pd.DataFrame(np.arange(9).reshape((3, 3))... | true | true |
f7155cefed90acb6d45f43fe242cbb9b2848c3cd | 5,649 | py | Python | recognition/ArcFace/sample_config.py | santapo/insightface | d61b09938bce244c4f775cee1d9d76ff641b7b0c | [
"MIT"
] | null | null | null | recognition/ArcFace/sample_config.py | santapo/insightface | d61b09938bce244c4f775cee1d9d76ff641b7b0c | [
"MIT"
] | null | null | null | recognition/ArcFace/sample_config.py | santapo/insightface | d61b09938bce244c4f775cee1d9d76ff641b7b0c | [
"MIT"
] | null | null | null | import numpy as np
import os
from easydict import EasyDict as edict
config = edict()
config.bn_mom = 0.9
config.workspace = 256
config.emb_size = 512
config.ckpt_embedding = True
config.net_se = 0
config.net_act = 'prelu'
config.net_unit = 3
config.net_input = 1
config.net_blocks = [1, 4, 6, 2]
config.net_output = 'E... | 25.561086 | 63 | 0.738007 | import numpy as np
import os
from easydict import EasyDict as edict
config = edict()
config.bn_mom = 0.9
config.workspace = 256
config.emb_size = 512
config.ckpt_embedding = True
config.net_se = 0
config.net_act = 'prelu'
config.net_unit = 3
config.net_input = 1
config.net_blocks = [1, 4, 6, 2]
config.net_output = 'E... | true | true |
f7155df326b76283c65218da1b03afe376a21473 | 540 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/wonderworks-33344 | 42cb504b280e4ad33598ae0d5ac64f8654e28205 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/wonderworks-33344 | 42cb504b280e4ad33598ae0d5ac64f8654e28205 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/wonderworks-33344 | 42cb504b280e4ad33598ae0d5ac64f8654e28205 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "wonderworks-33344.botics.co"
site_params = {
"name": "Wonderworks",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_... | 20.769231 | 61 | 0.659259 | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "wonderworks-33344.botics.co"
site_params = {
"name": "Wonderworks",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_... | true | true |
f7155e52ae7e7e0208d80c721374978ecf74f3d8 | 6,483 | py | Python | src/HCTool-sg-1.py | iShog/huaweicloudTool | 56b231d4707570e7690b68d31b3bfd8920e995bc | [
"MIT"
] | null | null | null | src/HCTool-sg-1.py | iShog/huaweicloudTool | 56b231d4707570e7690b68d31b3bfd8920e995bc | [
"MIT"
] | null | null | null | src/HCTool-sg-1.py | iShog/huaweicloudTool | 56b231d4707570e7690b68d31b3bfd8920e995bc | [
"MIT"
] | null | null | null | # coding: utf-8
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.http.http_config import HttpConfig
"""
# 导入指定云服务的库 huaweicloudsdk{service}
"""
from huaweicloudsdkvpc.v2 import *
from huaweicloudsdkvpc.v2.region.vpc_region imp... | 29.334842 | 114 | 0.637051 | from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.http.http_config import HttpConfig
from huaweicloudsdkvpc.v2 import *
from huaweicloudsdkvpc.v2.region.vpc_region import VpcRegion
from urllib.request import urlopen
from json ... | true | true |
f7155f2dc872416bc9d84bdcf46fa337e5c2a7ff | 2,567 | py | Python | aiida/orm/nodes/data/base.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | 1 | 2019-07-31T04:08:13.000Z | 2019-07-31T04:08:13.000Z | aiida/orm/nodes/data/base.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | aiida/orm/nodes/data/base.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 32.910256 | 106 | 0.586287 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import abc
import six
try:
from functools import singledispatch except ImportError:
from singledispatch import singledispatch
from .data import Data
__all__ = ('BaseType', 'to_aiida_type')
@single... | true | true |
f7155fab8edcad4a0881545f1487a35076b0b70c | 1,983 | py | Python | matchms/exporting/save_as_json.py | maximskorik/matchms | 922f5afaef123a793194bdd74391027477cbb844 | [
"Apache-2.0"
] | null | null | null | matchms/exporting/save_as_json.py | maximskorik/matchms | 922f5afaef123a793194bdd74391027477cbb844 | [
"Apache-2.0"
] | null | null | null | matchms/exporting/save_as_json.py | maximskorik/matchms | 922f5afaef123a793194bdd74391027477cbb844 | [
"Apache-2.0"
] | null | null | null | import json
from typing import List
import numpy
from ..Spectrum import Spectrum
def save_as_json(spectrums: List[Spectrum], filename: str):
"""Save spectrum(s) as json file.
:py:attr:`~matchms.Spectrum.losses` of spectrum will not be saved.
Example:
.. code-block:: python
import numpy
... | 33.610169 | 91 | 0.606657 | import json
from typing import List
import numpy
from ..Spectrum import Spectrum
def save_as_json(spectrums: List[Spectrum], filename: str):
if not isinstance(spectrums, list):
spectrums = [spectrums]
with open(filename, 'w', encoding="utf-8") as fout:
json.dump(spectrums, fout, c... | true | true |
f7156064ea7c64a030e87c3aff9f1fc1fc6f9c9f | 455 | py | Python | cvat/apps/git/migrations/0002_auto_20190123_1305.py | raunilillemets/cvat | c083b5d3a60270121abc3f3fe596ff94ae0eb60f | [
"MIT"
] | 2 | 2020-03-16T03:41:27.000Z | 2020-03-16T03:53:01.000Z | cvat/apps/git/migrations/0002_auto_20190123_1305.py | raunilillemets/cvat | c083b5d3a60270121abc3f3fe596ff94ae0eb60f | [
"MIT"
] | 29 | 2020-01-28T23:08:18.000Z | 2022-03-12T00:05:33.000Z | cvat/apps/git/migrations/0002_auto_20190123_1305.py | raunilillemets/cvat | c083b5d3a60270121abc3f3fe596ff94ae0eb60f | [
"MIT"
] | 7 | 2021-07-27T09:15:22.000Z | 2022-03-29T21:20:00.000Z | # Generated by Django 2.1.3 on 2019-01-23 10:05
import cvat.apps.git.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('git', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='gitdata',
nam... | 22.75 | 105 | 0.621978 |
import cvat.apps.git.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('git', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='gitdata',
name='status',
field=models.CharField(d... | true | true |
f71560690c6142fd8314899effc45720b4df6fdb | 1,016 | py | Python | Instagram/urls.py | samsoluoch/Instagram | ea6305c0592c8efe173cf3e6b5f1c477650678db | [
"MIT"
] | null | null | null | Instagram/urls.py | samsoluoch/Instagram | ea6305c0592c8efe173cf3e6b5f1c477650678db | [
"MIT"
] | null | null | null | Instagram/urls.py | samsoluoch/Instagram | ea6305c0592c8efe173cf3e6b5f1c477650678db | [
"MIT"
] | null | null | null | """instagram URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | 37.62963 | 79 | 0.687992 | from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('clone.urls')),
url(r'^', include('registration.backends.simple.urls')),
url(r'^logout/$', views.logout, {"next_page": '/'}... | true | true |
f7156125912203ecb4aa0ec75b8a4e46334dc991 | 7,299 | py | Python | setuper desktop app/gui/mainwindow/menubar.py | dragondjf/CloudSetuper | 31aefe629f7f2d59d287981eda3e4e618ace9e9f | [
"MIT"
] | 22 | 2015-01-08T12:54:20.000Z | 2021-05-16T04:15:45.000Z | setuper desktop app/gui/mainwindow/menubar.py | dragondjf/CloudSetuper | 31aefe629f7f2d59d287981eda3e4e618ace9e9f | [
"MIT"
] | null | null | null | setuper desktop app/gui/mainwindow/menubar.py | dragondjf/CloudSetuper | 31aefe629f7f2d59d287981eda3e4e618ace9e9f | [
"MIT"
] | 11 | 2015-01-25T01:26:45.000Z | 2021-08-18T01:40:40.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PyQt5 import QtGui
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from .guiconfig import collectView
class MenuBar(QtWidgets.QMenuBar):
viewID = "MenuBar"
@collectView
def __init__(self, parent):
super(MenuBar, self).__init__()
self.p... | 35.779412 | 76 | 0.307028 |
from PyQt5 import QtGui
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from .guiconfig import collectView
class MenuBar(QtWidgets.QMenuBar):
viewID = "MenuBar"
@collectView
def __init__(self, parent):
super(MenuBar, self).__init__()
self.parent = parent
self.actionlists = ... | true | true |
f715614c9c22bf521a77e23832bea7384f69ed20 | 729 | py | Python | var/spack/repos/builtin/packages/smartmontools/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/smartmontools/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/smartmontools/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 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.package import *
class Smartmontools(AutotoolsPackage):
"""S.M.A.R.T. utility toolset."""
homepage =... | 36.45 | 113 | 0.742112 |
from spack.package import *
class Smartmontools(AutotoolsPackage):
homepage = "https://smartmontools.sourceforge.net"
url = "https://nchc.dl.sourceforge.net/project/smartmontools/smartmontools/6.6/smartmontools-6.6.tar.gz"
version('6.6', sha256='51f43d0fb064fccaf823bbe68cf0d317d0895ff895aa353b3339... | true | true |
f71563894bd2d01be507073cac15fd01a629492a | 201,289 | py | Python | pyfakefs/fake_filesystem.py | jcwilson/pyfakefs | 95f15b7de426f6f6c75181f6d06abb6a75bba668 | [
"Apache-2.0"
] | null | null | null | pyfakefs/fake_filesystem.py | jcwilson/pyfakefs | 95f15b7de426f6f6c75181f6d06abb6a75bba668 | [
"Apache-2.0"
] | null | null | null | pyfakefs/fake_filesystem.py | jcwilson/pyfakefs | 95f15b7de426f6f6c75181f6d06abb6a75bba668 | [
"Apache-2.0"
] | null | null | null | # Copyright 2009 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 ... | 39.383487 | 80 | 0.605801 |
import errno
import heapq
import io
import locale
import os
import sys
import time
import uuid
from collections import namedtuple
from stat import (
S_IFREG, S_IFDIR, S_ISLNK, S_IFMT, S_ISDIR, S_IFLNK, S_ISREG, S_IFSOCK
)
from pyfakefs.deprecator import Deprecator
from pyfakefs.extra_packages import use_scandir
f... | true | true |
f71563a5ae0890e106de48a27661337660c13119 | 5,139 | py | Python | Lib/wsgiref/simple_server.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 11,058 | 2018-05-29T07:40:06.000Z | 2022-03-31T11:38:42.000Z | Lib/wsgiref/simple_server.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 2,105 | 2018-06-01T10:07:16.000Z | 2022-03-31T14:56:42.000Z | Lib/wsgiref/simple_server.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 914 | 2018-07-27T09:36:14.000Z | 2022-03-31T19:56:34.000Z | """BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application. It has not been reviewed for security issues,
however, and w... | 31.145455 | 79 | 0.627359 |
from http.server import BaseHTTPRequestHandler, HTTPServer
import sys
import urllib.parse
from wsgiref.handlers import SimpleHandler
from platform import python_implementation
__version__ = "0.2"
__all__ = ['WSGIServer', 'WSGIRequestHandler', 'demo_app', 'make_server']
server_version = "WSGIServer/" + __version__
s... | true | true |
f71563a970e54d91f082ae73af7abad4a8b23fdf | 205 | py | Python | exe.curso em video/def 20.py | Lorenzo-Lopes/Python-Estudo | 7ee623ce29b6a0e9fac48189fbd9c641be84d418 | [
"MIT"
] | null | null | null | exe.curso em video/def 20.py | Lorenzo-Lopes/Python-Estudo | 7ee623ce29b6a0e9fac48189fbd9c641be84d418 | [
"MIT"
] | null | null | null | exe.curso em video/def 20.py | Lorenzo-Lopes/Python-Estudo | 7ee623ce29b6a0e9fac48189fbd9c641be84d418 | [
"MIT"
] | null | null | null | import random
n1 = str(input('nome 1='))
n2 = str(input('nome 2='))
n3 = str(input('nome 3='))
n4 = str(input('nome 4='))
lista = [n1, n2, n3, n4]
random.shuffle(lista)
print('nova ordem{}'.format(lista))
| 22.777778 | 35 | 0.62439 | import random
n1 = str(input('nome 1='))
n2 = str(input('nome 2='))
n3 = str(input('nome 3='))
n4 = str(input('nome 4='))
lista = [n1, n2, n3, n4]
random.shuffle(lista)
print('nova ordem{}'.format(lista))
| true | true |
f715643f43f6a40626ee3423dc028f67fe0c8522 | 113 | py | Python | mass/views.py | lsapan/channels-mass-broadcast | 4f60e059ea9e3a861cc47250347900a4d0b8bd7f | [
"MIT"
] | null | null | null | mass/views.py | lsapan/channels-mass-broadcast | 4f60e059ea9e3a861cc47250347900a4d0b8bd7f | [
"MIT"
] | null | null | null | mass/views.py | lsapan/channels-mass-broadcast | 4f60e059ea9e3a861cc47250347900a4d0b8bd7f | [
"MIT"
] | null | null | null | from django.views.generic.base import TemplateView
class AppView(TemplateView):
template_name = 'app.html'
| 18.833333 | 50 | 0.778761 | from django.views.generic.base import TemplateView
class AppView(TemplateView):
template_name = 'app.html'
| true | true |
f715657d3665bb54ea1ce0ca055aa8948d82a119 | 17,134 | py | Python | Lib/test/test_dict.py | weimingtom/wpython | d51bfe48ec4c0ade1514f1351dff700c63ca112a | [
"PSF-2.0"
] | 5 | 2020-06-30T05:06:40.000Z | 2021-05-24T08:38:33.000Z | Lib/test/test_dict.py | weimingtom/wpython | d51bfe48ec4c0ade1514f1351dff700c63ca112a | [
"PSF-2.0"
] | null | null | null | Lib/test/test_dict.py | weimingtom/wpython | d51bfe48ec4c0ade1514f1351dff700c63ca112a | [
"PSF-2.0"
] | 2 | 2015-10-01T18:28:20.000Z | 2020-09-09T16:25:27.000Z | import unittest
from test import test_support
import UserDict, random, string
class DictTest(unittest.TestCase):
def test_constructor(self):
# calling built-in types without argument must return empty
self.assertEqual(dict(), {})
self.assert_(dict() is not {})
def test_literal_constr... | 29.592401 | 94 | 0.487744 | import unittest
from test import test_support
import UserDict, random, string
class DictTest(unittest.TestCase):
def test_constructor(self):
self.assertEqual(dict(), {})
self.assert_(dict() is not {})
def test_literal_constructor(self):
for n in (0, 1, 6, 256, 400):
... | false | true |
f71565b7be10bec97c68c9837cc952d9b34744fe | 886 | py | Python | s5/local/extract_text.py | cadia-lvl/althingi-asr | 8830f40b8302834fc8176727a36ca8136cd9eedc | [
"Apache-2.0"
] | 4 | 2017-11-10T19:43:43.000Z | 2019-07-03T12:12:09.000Z | egs/althingi/s5/local/extract_text.py | ingarun/kaldi | 362ad3235c9740c0dfb0481cfbff81ca4604222d | [
"Apache-2.0"
] | null | null | null | egs/althingi/s5/local/extract_text.py | ingarun/kaldi | 362ad3235c9740c0dfb0481cfbff81ca4604222d | [
"Apache-2.0"
] | 1 | 2017-11-06T18:28:53.000Z | 2017-11-06T18:28:53.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import glob
import os
import codecs
import re
#from bs4 import BeautifulSoup
with codecs.open(sys.argv[2],'w',encoding='utf-8') as fout:
xmlpaths = glob.glob(os.path.join(sys.argv[1],'*.xml'))
for file in xmlpaths:
file_base = os.path.split... | 35.44 | 81 | 0.565463 |
import sys
import glob
import os
import codecs
import re
with codecs.open(sys.argv[2],'w',encoding='utf-8') as fout:
xmlpaths = glob.glob(os.path.join(sys.argv[1],'*.xml'))
for file in xmlpaths:
file_base = os.path.splitext(os.path.basename(file))[0]
with codecs.open(file,'r',encoding='utf... | true | true |
f715670072d1d78f8599fbbeeae887a4a8b445cc | 2,970 | py | Python | news/views.py | serg1ua/today-ua | 6a3ad99c924884db81ecbdb5d3dc2255dd927b4e | [
"MIT"
] | null | null | null | news/views.py | serg1ua/today-ua | 6a3ad99c924884db81ecbdb5d3dc2255dd927b4e | [
"MIT"
] | null | null | null | news/views.py | serg1ua/today-ua | 6a3ad99c924884db81ecbdb5d3dc2255dd927b4e | [
"MIT"
] | null | null | null | import json
from django.http import HttpResponse, Http404, HttpResponseRedirect, JsonResponse
from django.shortcuts import render
from django.urls import reverse
from .models import Article
get_articles = 10
# Create your views here.
def index(request):
# print(dir(request))
return HttpResponseRedirect(revers... | 27.757009 | 90 | 0.653535 | import json
from django.http import HttpResponse, Http404, HttpResponseRedirect, JsonResponse
from django.shortcuts import render
from django.urls import reverse
from .models import Article
get_articles = 10
def index(request):
return HttpResponseRedirect(reverse("main"))
def main(request):
try:
... | true | true |
f715672884f4a836d1e1572dda38ea12b14cfb27 | 8,758 | py | Python | lib/rucio/tests/conftest.py | chrisburr/rucio | 735f628231cd9fae64adc31c9f548b14d5ca01d3 | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/conftest.py | chrisburr/rucio | 735f628231cd9fae64adc31c9f548b14d5ca01d3 | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/conftest.py | chrisburr/rucio | 735f628231cd9fae64adc31c9f548b14d5ca01d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020-2021 CERN
#
# 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... | 33.945736 | 125 | 0.716716 |
from __future__ import print_function
import traceback
import pytest
@pytest.fixture(scope='session')
def vo():
from rucio.common.config import config_get_bool, config_get
if config_get_bool('common', 'multi_vo', raise_exception=False, default=False):
return config_get('client', 'vo', raise_except... | true | true |
f71567dd29ec05db09822d985693d9e42b0f36ec | 394 | py | Python | src/param.py | xiajing10/akec | 239fdda923c8a0743f56dbf0a009fa2235b85451 | [
"MIT"
] | 14 | 2021-01-28T07:13:25.000Z | 2022-02-10T06:41:32.000Z | src/param.py | xiajing10/akec | 239fdda923c8a0743f56dbf0a009fa2235b85451 | [
"MIT"
] | 2 | 2021-04-14T15:24:30.000Z | 2021-05-06T07:02:08.000Z | src/param.py | xiajing10/akec | 239fdda923c8a0743f56dbf0a009fa2235b85451 | [
"MIT"
] | 1 | 2021-07-09T02:52:59.000Z | 2021-07-09T02:52:59.000Z | # -*- coding: utf-8 -*-
"""
@author: eilxaix
"""
param = {
'data_path': '../dataset/ieee_xai.csv',
'terms_path': '../dataset/domain_terms.txt',
'conceptnet_emb': './embed_data/numberbatch-en-19.08.txt',
'elmo_options':'./embed_data/elmo_2x4096_512_2048cnn_2xhighway_5.5B_options.json',
'elmo_weight... | 32.833333 | 87 | 0.690355 |
param = {
'data_path': '../dataset/ieee_xai.csv',
'terms_path': '../dataset/domain_terms.txt',
'conceptnet_emb': './embed_data/numberbatch-en-19.08.txt',
'elmo_options':'./embed_data/elmo_2x4096_512_2048cnn_2xhighway_5.5B_options.json',
'elmo_weight':'./embed_data/elmo_2x4096_512_2048cnn_2xhighway... | true | true |
f71568ebb68f9faa9d28c57f4a9204630dfb7a43 | 18,797 | py | Python | transfer_subnet/xiaoketransfer2.py | LenKerr/Colorization-1 | bcfcdb24fc8ab107d34644d5a63b018f86784e21 | [
"MIT"
] | 30 | 2020-06-21T09:29:51.000Z | 2022-03-26T07:32:52.000Z | transfer_subnet/xiaoketransfer2.py | LenKerr/Colorization-1 | bcfcdb24fc8ab107d34644d5a63b018f86784e21 | [
"MIT"
] | 5 | 2020-09-27T09:45:44.000Z | 2021-10-20T11:45:04.000Z | transfer_subnet/xiaoketransfer2.py | xuzhongyou/Colorization | bcfcdb24fc8ab107d34644d5a63b018f86784e21 | [
"MIT"
] | 7 | 2020-07-03T02:55:25.000Z | 2021-12-18T10:38:41.000Z | """
Copyright (c) 2019 NAVER Corp.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, su... | 42.623583 | 297 | 0.665638 | import os
os.environ['CUDA_VISIBLE_DEVICES']='1'
import sys
sys.path.append('./segmentation')
import os
import tqdm
import argparse
import torch
from torchvision.utils import save_image
import torch.nn as nn
from utils.core import feature_wct
from utils.core import feature_adin
from utils.core import feature_adin_wit... | true | true |
f7156985db791f120b85f1fb241fe315d40a1d08 | 16,415 | py | Python | retrain_yolo.py | mukulbhave/YAD2K | a6174285e036f95df83783b7b4d951094cbb08c8 | [
"MIT"
] | null | null | null | retrain_yolo.py | mukulbhave/YAD2K | a6174285e036f95df83783b7b4d951094cbb08c8 | [
"MIT"
] | null | null | null | retrain_yolo.py | mukulbhave/YAD2K | a6174285e036f95df83783b7b4d951094cbb08c8 | [
"MIT"
] | null | null | null | """
This is a script that can be used to retrain the YOLOv2 model for your own dataset.
"""
import argparse
import os
from PIL import ImageOps
import matplotlib.pyplot as plt
import numpy as np
import PIL
import tensorflow as tf
from keras import backend as K
from keras.layers import Input, Lambda, Conv2D
from keras.m... | 39.176611 | 157 | 0.648005 | import argparse
import os
from PIL import ImageOps
import matplotlib.pyplot as plt
import numpy as np
import PIL
import tensorflow as tf
from keras import backend as K
from keras.layers import Input, Lambda, Conv2D
from keras.models import load_model, Model
from keras import regularizers
from keras.callbacks import Te... | true | true |
f7156a419031a548f8c6765c306917d7d0a579d2 | 399 | py | Python | chilled-vibes.py | bcgreen24/ten-lines-or-less | 7a34ff7d7222fd3946e9cbb418afc992bc84e5e5 | [
"MIT"
] | 44 | 2018-08-15T08:32:43.000Z | 2022-02-15T20:25:03.000Z | chilled-vibes.py | bcgreen24/ten-lines-or-less | 7a34ff7d7222fd3946e9cbb418afc992bc84e5e5 | [
"MIT"
] | null | null | null | chilled-vibes.py | bcgreen24/ten-lines-or-less | 7a34ff7d7222fd3946e9cbb418afc992bc84e5e5 | [
"MIT"
] | 7 | 2018-09-08T20:05:58.000Z | 2021-11-22T12:46:15.000Z | Clock.bpm=100; Scale.default="minor"
p1 >> pulse([0,-1,-2,-3], dur=8, lpf=600, lpr=0.2, crush=8) + (0,2,4,const(6))
p3 >> blip(p1.pitch, dur=8, sus=4, room=1, oct=6) + [0,0,0,P*(2,4,3,-1)]
p2 >> saw(P[:5][:9][:16], dur=1/4, oct=var([3,4],[12,4])).penta()
d1 >> play("(x )( x)o{ vx[xx]}", crush=16, rate=.8).every([24,5,3... | 57 | 88 | 0.526316 | Clock.bpm=100; Scale.default="minor"
p1 >> pulse([0,-1,-2,-3], dur=8, lpf=600, lpr=0.2, crush=8) + (0,2,4,const(6))
p3 >> blip(p1.pitch, dur=8, sus=4, room=1, oct=6) + [0,0,0,P*(2,4,3,-1)]
p2 >> saw(P[:5][:9][:16], dur=1/4, oct=var([3,4],[12,4])).penta()
d1 >> play("(x )( x)o{ vx[xx]}", crush=16, rate=.8).every([24,5,3... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.