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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08fdac4914dd9be641a13d505aef69b65864d404 | 1,985 | py | Python | aodh/storage/impl_log.py | ISCAS-VDI/aodh-base | 4e7a8aef80054c49e8e8b32715cecd32b425d617 | [
"Apache-2.0"
] | null | null | null | aodh/storage/impl_log.py | ISCAS-VDI/aodh-base | 4e7a8aef80054c49e8e8b32715cecd32b425d617 | [
"Apache-2.0"
] | null | null | null | aodh/storage/impl_log.py | ISCAS-VDI/aodh-base | 4e7a8aef80054c49e8e8b32715cecd32b425d617 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 28.357143 | 76 | 0.655919 |
from oslo_log import log
from aodh.i18n import _LI
from aodh.storage import base
LOG = log.getLogger(__name__)
class Connection(base.Connection):
@staticmethod
def upgrade():
pass
@staticmethod
def clear():
pass
@staticmethod
def get_alarms(name=None, user=None, state=Non... | true | true |
08fdac51d09f98c98eec855e58cf00710b591130 | 4,016 | py | Python | Full_Docker/web/mydjango/mydjango/settings.py | ShaonMahmood/Dockerize-python-projects | 24503f7924e42af439a98a3493e4548517e02962 | [
"MIT"
] | 2 | 2019-07-16T07:26:01.000Z | 2019-07-16T07:26:26.000Z | Full_Docker/web/mydjango/mydjango/settings.py | sujonict07/Dockerize-python-projects | 24503f7924e42af439a98a3493e4548517e02962 | [
"MIT"
] | 3 | 2020-02-12T02:58:37.000Z | 2021-06-10T21:41:28.000Z | Full_Docker/web/mydjango/mydjango/settings.py | sujonict07/Dockerize-python-projects | 24503f7924e42af439a98a3493e4548517e02962 | [
"MIT"
] | 1 | 2019-07-16T07:26:38.000Z | 2019-07-16T07:26:38.000Z | """
Django settings for mydjango project.
Generated by 'django-admin startproject' using Django 1.11.10.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... | 27.319728 | 91 | 0.638446 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '%=-7uj2)t+zkq5&7iap7q9fr=dieir-8ce#(-cl(mv5)@q%95s'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
08fdac82fc3c60532e16e56b23b5473274c0b234 | 1,350 | py | Python | sql_helper/__init__.py | xQwexx/sql-helper | 8c1984b90777b0119e110d5a7d60460090c377d1 | [
"MIT"
] | null | null | null | sql_helper/__init__.py | xQwexx/sql-helper | 8c1984b90777b0119e110d5a7d60460090c377d1 | [
"MIT"
] | null | null | null | sql_helper/__init__.py | xQwexx/sql-helper | 8c1984b90777b0119e110d5a7d60460090c377d1 | [
"MIT"
] | null | null | null | import re
import settings_helper as sh
from sqlalchemy import create_engine
from postgresql import PostgresqlEngine
from mysql import MysqlEngine
from sql import SQLEngine
get_setting = sh.settings_getter(__name__)
sql_url = get_setting('sql_url')
connect_timeout = get_setting('connect_timeout', 5)
rx_mysql = re.compi... | 32.926829 | 81 | 0.714815 | import re
import settings_helper as sh
from sqlalchemy import create_engine
from postgresql import PostgresqlEngine
from mysql import MysqlEngine
from sql import SQLEngine
get_setting = sh.settings_getter(__name__)
sql_url = get_setting('sql_url')
connect_timeout = get_setting('connect_timeout', 5)
rx_mysql = re.compi... | true | true |
08fdacc2a8fe7c0dcbdf2ca6ce7239b1cee76086 | 408 | py | Python | preprocessing/mongo_cli.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | preprocessing/mongo_cli.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | preprocessing/mongo_cli.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | db.cloneCollection('ip:host','from coll','to coll')
db.copyDatabase('from db','to db','ip:host')
db.copyDatabase(<from_dbname>, <to_dbname>, <from_hostname>, <username>,<password>);
db.copyDatabase(
"tweet",
"tweet",
"example.net",
"admin",
"lixiepeng",
"MONGODB-CR"
)
mongodump -h IP --port 端口 -u 用户... | 27.2 | 84 | 0.64951 | db.cloneCollection('ip:host','from coll','to coll')
db.copyDatabase('from db','to db','ip:host')
db.copyDatabase(<from_dbname>, <to_dbname>, <from_hostname>, <username>,<password>);
db.copyDatabase(
"tweet",
"tweet",
"example.net",
"admin",
"lixiepeng",
"MONGODB-CR"
)
mongodump -h IP --port 端口 -u 用户... | false | true |
08fdaed3b91f3e6494bfe5b57afce6464e4e9c40 | 2,322 | py | Python | magpie/api/management/user/user_formats.py | Ouranosinc/Magpie | 24c4ec2d3f98eb71fba7b199281882dbc62b6693 | [
"Apache-2.0"
] | null | null | null | magpie/api/management/user/user_formats.py | Ouranosinc/Magpie | 24c4ec2d3f98eb71fba7b199281882dbc62b6693 | [
"Apache-2.0"
] | 366 | 2017-10-04T14:58:52.000Z | 2022-03-16T21:44:07.000Z | magpie/api/management/user/user_formats.py | Ouranosinc/Magpie | 24c4ec2d3f98eb71fba7b199281882dbc62b6693 | [
"Apache-2.0"
] | 3 | 2018-09-05T13:46:04.000Z | 2021-02-05T14:52:15.000Z | from typing import TYPE_CHECKING
from pyramid.httpexceptions import HTTPInternalServerError
from magpie.api.exception import evaluate_call
from magpie.constants import get_constant
from magpie.models import UserGroupStatus, UserStatuses
if TYPE_CHECKING:
from typing import List
from magpie.models import Any... | 38.7 | 119 | 0.66882 | from typing import TYPE_CHECKING
from pyramid.httpexceptions import HTTPInternalServerError
from magpie.api.exception import evaluate_call
from magpie.constants import get_constant
from magpie.models import UserGroupStatus, UserStatuses
if TYPE_CHECKING:
from typing import List
from magpie.models import Any... | true | true |
08fdaee163e9c8ab5cf7fe48593db0e3444f8a3a | 3,213 | py | Python | ddbc/cache.py | marcy-terui/ddbc | 6d5ba48c020f58fae2131782d5eecd834fbc458b | [
"MIT"
] | 1 | 2017-10-15T16:14:01.000Z | 2017-10-15T16:14:01.000Z | ddbc/cache.py | marcy-terui/ddbc | 6d5ba48c020f58fae2131782d5eecd834fbc458b | [
"MIT"
] | 2 | 2018-03-29T08:25:42.000Z | 2018-03-29T08:36:48.000Z | ddbc/cache.py | marcy-terui/ddbc | 6d5ba48c020f58fae2131782d5eecd834fbc458b | [
"MIT"
] | 1 | 2018-03-07T06:57:13.000Z | 2018-03-07T06:57:13.000Z | # -*- coding: utf-8 -*-
import botocore
import time
import hashlib
import pickle
from ddbc.utils import get_table
class Client(object):
cache = {}
def __init__(
self,
table_name,
region=None,
default_ttl=-1,
report_error=False
):
self.table = get_table(ta... | 24.340909 | 73 | 0.549953 |
import botocore
import time
import hashlib
import pickle
from ddbc.utils import get_table
class Client(object):
cache = {}
def __init__(
self,
table_name,
region=None,
default_ttl=-1,
report_error=False
):
self.table = get_table(table_name, region)
... | true | true |
08fdaeef5f7643720eaa88ba403151f98d61e07a | 5,872 | py | Python | flutterwave_python/rave_paymentplan.py | gathuaalex/Flutterwave-python-v3 | 819c6b18623ee2793bfcf871c32a6c9061ab01bc | [
"MIT"
] | null | null | null | flutterwave_python/rave_paymentplan.py | gathuaalex/Flutterwave-python-v3 | 819c6b18623ee2793bfcf871c32a6c9061ab01bc | [
"MIT"
] | null | null | null | flutterwave_python/rave_paymentplan.py | gathuaalex/Flutterwave-python-v3 | 819c6b18623ee2793bfcf871c32a6c9061ab01bc | [
"MIT"
] | null | null | null | import requests, json, copy
from flutterwave_python.rave_base import RaveBase
from flutterwave_python.rave_misc import checkIfParametersAreComplete, generateTransactionReference
from flutterwave_python.rave_exceptions import ServerError, IncompletePaymentDetailsError, PlanCreationError, PlanStatusError
class Pay... | 49.762712 | 140 | 0.634366 | import requests, json, copy
from flutterwave_python.rave_base import RaveBase
from flutterwave_python.rave_misc import checkIfParametersAreComplete, generateTransactionReference
from flutterwave_python.rave_exceptions import ServerError, IncompletePaymentDetailsError, PlanCreationError, PlanStatusError
class Pay... | true | true |
08fdaf7d0ecbc12b94ac138e2518cd806c66a56b | 856 | py | Python | social/pipeline/mail.py | Diolor/python-social-auth | ba4e30d4a11b2e188954770bae4df9426d61a470 | [
"BSD-3-Clause"
] | 1 | 2015-04-19T21:38:46.000Z | 2015-04-19T21:38:46.000Z | social/pipeline/mail.py | nvbn/python-social-auth | 3e0e99404f20e7b6847ca069e0844ba8c090415f | [
"BSD-3-Clause"
] | null | null | null | social/pipeline/mail.py | nvbn/python-social-auth | 3e0e99404f20e7b6847ca069e0844ba8c090415f | [
"BSD-3-Clause"
] | 1 | 2020-05-23T05:49:36.000Z | 2020-05-23T05:49:36.000Z | from social.exceptions import InvalidEmail
from social.pipeline.partial import partial
@partial
def mail_validation(strategy, details, user=None, is_new=False,
*args, **kwargs):
if user is None or is_new and details.get('email'):
data = strategy.request_data()
if 'code' in data... | 45.052632 | 78 | 0.679907 | from social.exceptions import InvalidEmail
from social.pipeline.partial import partial
@partial
def mail_validation(strategy, details, user=None, is_new=False,
*args, **kwargs):
if user is None or is_new and details.get('email'):
data = strategy.request_data()
if 'code' in data... | true | true |
08fdafb446ebf446250d60f4fbb416ed8970a25c | 3,203 | py | Python | src/code/File-Genx-CLI.py | pedroter7/file-genx | cdd56fc15183004e4a5a5afe402381bc1f44bef1 | [
"MIT"
] | 1 | 2020-10-30T17:49:02.000Z | 2020-10-30T17:49:02.000Z | src/code/File-Genx-CLI.py | pedroter7/file-genx | cdd56fc15183004e4a5a5afe402381bc1f44bef1 | [
"MIT"
] | 1 | 2022-01-19T12:01:14.000Z | 2022-01-19T12:01:14.000Z | src/code/File-Genx-CLI.py | pedroter7/file-genx | cdd56fc15183004e4a5a5afe402381bc1f44bef1 | [
"MIT"
] | null | null | null | '''
Title: File Genx (CLI version)
License: MIT
GitHub: https://github.com/pedroter7/file-genx
This is a CLI version of File Genx. This script works by simply 'emulating' the GUI input.
'''
from argparse import ArgumentParser
from Generator import Generator
VALID_CONTENT_PER_STRINGS = [
'line',
'char',
... | 35.197802 | 262 | 0.71152 |
from argparse import ArgumentParser
from Generator import Generator
VALID_CONTENT_PER_STRINGS = [
'line',
'char',
'par'
]
VALID_CONTENT_TYPE_STRINGS = [
'rand',
'web-lipsum'
]
def createArgParser():
argParser = ArgumentParser(
description='File-Genx CLI version. Visit https://github... | true | true |
08fdb03feb584cf9a0abbb763767db34c0a810bf | 4,579 | py | Python | app/conference/api/conference.py | confbot-telegram-conferences/confbot | 52fa307275b679748b5a7a6e7cb29bfc7b792875 | [
"MIT"
] | 1 | 2022-01-18T05:19:45.000Z | 2022-01-18T05:19:45.000Z | app/conference/api/conference.py | confbot-telegram-conferences/confbot | 52fa307275b679748b5a7a6e7cb29bfc7b792875 | [
"MIT"
] | null | null | null | app/conference/api/conference.py | confbot-telegram-conferences/confbot | 52fa307275b679748b5a7a6e7cb29bfc7b792875 | [
"MIT"
] | 1 | 2022-01-18T13:54:57.000Z | 2022-01-18T13:54:57.000Z | from app.conference.api.filters.conference import ConferenceFilter
from django.http.response import Http404
from app.conference.api.serializers.slide import SlideSerializer
from app.conference.models.slide import Slide
from rest_framework import filters
from django_filters.rest_framework import DjangoFilterBackend
from... | 45.336634 | 118 | 0.732256 | from app.conference.api.filters.conference import ConferenceFilter
from django.http.response import Http404
from app.conference.api.serializers.slide import SlideSerializer
from app.conference.models.slide import Slide
from rest_framework import filters
from django_filters.rest_framework import DjangoFilterBackend
from... | true | true |
08fdb04013d927c6798a466f66db41ff0d0fa70b | 21,905 | py | Python | tests/test_transforms/test_gale_shapley.py | Carlosbogo/etna | b6210f0e79ee92aa9ae8ff4fcfb267be9fb7cc94 | [
"Apache-2.0"
] | null | null | null | tests/test_transforms/test_gale_shapley.py | Carlosbogo/etna | b6210f0e79ee92aa9ae8ff4fcfb267be9fb7cc94 | [
"Apache-2.0"
] | null | null | null | tests/test_transforms/test_gale_shapley.py | Carlosbogo/etna | b6210f0e79ee92aa9ae8ff4fcfb267be9fb7cc94 | [
"Apache-2.0"
] | null | null | null | from typing import Dict
from typing import List
import numpy as np
import pandas as pd
import pytest
from etna.analysis.feature_relevance import StatisticsRelevanceTable
from etna.datasets import TSDataset
from etna.datasets import generate_ar_df
from etna.datasets import generate_periodic_df
from etna.transforms.gal... | 37.380546 | 118 | 0.566263 | from typing import Dict
from typing import List
import numpy as np
import pandas as pd
import pytest
from etna.analysis.feature_relevance import StatisticsRelevanceTable
from etna.datasets import TSDataset
from etna.datasets import generate_ar_df
from etna.datasets import generate_periodic_df
from etna.transforms.gal... | true | true |
08fdb08a818e6d2cd1970913d04afa890dcec739 | 10,368 | py | Python | test/dns_compat_test.py | olopez32/syncless | acae1fa84e3ae228c2f238c5a27f4fdb5b2546fc | [
"Apache-2.0"
] | 1 | 2019-03-29T12:44:33.000Z | 2019-03-29T12:44:33.000Z | test/dns_compat_test.py | HanWenfang/syncless | acae1fa84e3ae228c2f238c5a27f4fdb5b2546fc | [
"Apache-2.0"
] | 1 | 2016-06-20T08:51:05.000Z | 2016-06-20T08:51:05.000Z | test/dns_compat_test.py | HanWenfang/syncless | acae1fa84e3ae228c2f238c5a27f4fdb5b2546fc | [
"Apache-2.0"
] | null | null | null | #! /usr/local/bin/stackless2.6
# by pts@fazekas.hu at Tue Feb 2 21:18:10 CET 2010
import cStringIO
import syncless.coio
import socket
import unittest
# TODO(pts): Test reverse lookup without canonical name.
# TODO(pts): Test for IPv6 addresses:
# print syncless.coio.dns_resolve_ipv6('www.ipv6.org')
#: <dnsresult ... | 40.818898 | 93 | 0.560089 |
import cStringIO
import syncless.coio
import socket
import unittest
ERR_NODATA = set([1])
ERR_ADDRFAMILY = set([2])
ERR_HOST_NOT_FOUND = set([3])
ERR_NONAME = set([4])
RESOLVE_IPV4_RESULT = {
'152.66.84.8': ['152.66.84.8'],
'127.5.6.7': ['127.5.6.7'],
'74.125.39.106': ['74.125.3... | false | true |
08fdb234a5a57f0658a101cdabd690cd6da9903e | 2,931 | py | Python | CIM100/IEC61968/PaymentMetering/Card.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM100/IEC61968/PaymentMetering/Card.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM100/IEC61968/PaymentMetering/Card.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | 38.565789 | 157 | 0.676561 |
from CIM100.Element import Element
class Card(Element):
def __init__(self, cvNumber='', expiryDate='', pan='', accountHolderName='', Tender=None, *args, **kw_args):
self.cvNumber = cvNumber
self.expiryDate = expiryDate
self.pan = pan
self.account... | true | true |
08fdb24192b44b8947f60aba90d76ab0bcf6661e | 7,098 | py | Python | DecryptLogin/modules/core/qunar.py | hedou/DecryptLogin | ff86a5d378c8a42d1caebbb7482658a95053f716 | [
"Apache-2.0"
] | null | null | null | DecryptLogin/modules/core/qunar.py | hedou/DecryptLogin | ff86a5d378c8a42d1caebbb7482658a95053f716 | [
"Apache-2.0"
] | null | null | null | DecryptLogin/modules/core/qunar.py | hedou/DecryptLogin | ff86a5d378c8a42d1caebbb7482658a95053f716 | [
"Apache-2.0"
] | null | null | null | '''
Function:
去哪儿旅行模拟登录
Author:
Charles
微信公众号:
Charles的皮卡丘
更新日期:
2022-04-23
'''
import os
import re
import time
import requests
from ..utils import removeImage, showImage, saveImage
'''PC端登录去哪儿旅行'''
class qunarPC():
is_callable = True
def __init__(self, **kwargs):
for key, value in kwa... | 39.653631 | 143 | 0.591293 | import os
import re
import time
import requests
from ..utils import removeImage, showImage, saveImage
class qunarPC():
is_callable = True
def __init__(self, **kwargs):
for key, value in kwargs.items(): setattr(self, key, value)
self.info = 'login in qunar in pc mode'
self.cur_path = os... | true | true |
08fdb3a29ab0a70d3a54b99020975da08bce4885 | 1,202 | py | Python | .history/my_classes/FunctionParameters/default_values_20210702201912.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FunctionParameters/default_values_20210702201912.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FunctionParameters/default_values_20210702201912.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """[Default values]
What happens at run time...
When modules are loaded: All the code is executed immediately.
Module Code
a = 10 the interger object 10 is created and a references it.
def func(a): the function object is created, and func references it.
print(a)
... | 29.317073 | 195 | 0.657238 | true | true | |
08fdb468d15f60e8758ad16b63558857d96c40f7 | 8,581 | py | Python | launch.py | jmhayesesq/Open-Chem | e612d5cd471079c64e61ceda946c3dc7cf095bd8 | [
"MIT"
] | 466 | 2018-08-10T04:58:42.000Z | 2022-03-29T07:04:39.000Z | launch.py | jmhayesesq/Open-Chem | e612d5cd471079c64e61ceda946c3dc7cf095bd8 | [
"MIT"
] | 15 | 2019-08-06T08:23:11.000Z | 2022-01-23T22:39:52.000Z | launch.py | jmhayesesq/Open-Chem | e612d5cd471079c64e61ceda946c3dc7cf095bd8 | [
"MIT"
] | 91 | 2018-08-19T00:37:50.000Z | 2022-02-27T11:15:31.000Z | # Adapted from https://github.com/pytorch/pytorch/blob/master/torch/distributed/launch.py
r"""
`torch.distributed.launch` is a module that spawns up multiple distributed
training processes on each of the training nodes.
The utility can be used for single-node distributed training, in which one or
more processes per n... | 37.147186 | 89 | 0.643748 |
import subprocess
import os
import socket
from argparse import ArgumentParser, REMAINDER
import torch
def parse_args():
parser = ArgumentParser(description="PyTorch distributed training launch "
"helper utilty that will spawn up "
... | true | true |
08fdb542ae7e0ac1ebe344ee2948acf29ca299f7 | 9,934 | py | Python | autotest/gdrivers/aaigrid.py | chambbj/gdal | 3d56aecb5b8e9890dae8f560acd099992e707d12 | [
"MIT"
] | 1 | 2015-02-16T16:51:38.000Z | 2015-02-16T16:51:38.000Z | autotest/gdrivers/aaigrid.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | autotest/gdrivers/aaigrid.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test Arc/Info ASCII Grid support.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
##############################################################################... | 33.22408 | 618 | 0.580532 |
import os
import sys
from osgeo import gdal
sys.path.append( '../pymod' )
import gdaltest
def aaigrid_1():
tst = gdaltest.GDALTest( 'aaigrid', 'pixel_per_line.asc', 1, 1123 )
return tst.testOpen()
def aaigrid_2():
ds = gdal.Open( 'data/pixel_per_line.asc' )
gt = ds.GetGeoTransform()
if gt... | true | true |
08fdb5a3aae6d559cce25edba996e55996be056b | 1,164 | py | Python | leetcode-random/par-equal-sum-subset.py | kd82/interview-preparation | a47de06c677b37c8160d1429f43e38288c157754 | [
"MIT"
] | null | null | null | leetcode-random/par-equal-sum-subset.py | kd82/interview-preparation | a47de06c677b37c8160d1429f43e38288c157754 | [
"MIT"
] | null | null | null | leetcode-random/par-equal-sum-subset.py | kd82/interview-preparation | a47de06c677b37c8160d1429f43e38288c157754 | [
"MIT"
] | null | null | null | from collections import List
class Solution:
def canPartition(self, nums: List[int]) -> bool:
# @lru_cache(maxsize = None) can be used to cache the results
def dfs(index, s):
if s == subsetSum:
return True
if s > subsetSum or index >= len(nums):
... | 36.375 | 94 | 0.477663 | from collections import List
class Solution:
def canPartition(self, nums: List[int]) -> bool:
def dfs(index, s):
if s == subsetSum:
return True
if s > subsetSum or index >= len(nums):
return False
return dfs(index + 1, s) or dfs(ind... | true | true |
08fdb5b41f0a17b03a673733d4ec3c243f2c262d | 371 | py | Python | Web/XSS/XSS_InHeaders.py | OblackatO/OffensiveSecurity | 4b2c5f981cf41cc463791f279c3ad0115c28d738 | [
"MIT"
] | 1 | 2018-05-09T05:51:35.000Z | 2018-05-09T05:51:35.000Z | Web/XSS/XSS_InHeaders.py | pegom96/OffensiveSecurity | 4b2c5f981cf41cc463791f279c3ad0115c28d738 | [
"MIT"
] | null | null | null | Web/XSS/XSS_InHeaders.py | pegom96/OffensiveSecurity | 4b2c5f981cf41cc463791f279c3ad0115c28d738 | [
"MIT"
] | null | null | null | import requests as r
import sys
payloads = ['<script>alert(1);</script>','<scrscriptipt>alert(1);</scrscriptipt>', '<BODYONLOAD=alert(1)>']
headers = {}
try:
ri = r.head(sys.argv[1])
except:
ri = r.get(sys.argv[1])
if ri.headers != None:
for payload in payloads :
for header in re.headers :
headers[heade... | 21.823529 | 107 | 0.660377 | import requests as r
import sys
payloads = ['<script>alert(1);</script>','<scrscriptipt>alert(1);</scrscriptipt>', '<BODYONLOAD=alert(1)>']
headers = {}
try:
ri = r.head(sys.argv[1])
except:
ri = r.get(sys.argv[1])
if ri.headers != None:
for payload in payloads :
for header in re.headers :
headers[heade... | true | true |
08fdb74e1a8d4491f63a024b8235ee57be9f7545 | 37,459 | py | Python | openmmtools/multistate/sams.py | Lnaden/openmmtools | 7a9c61cea5c657e333f433dabbd7c87624f8227f | [
"MIT"
] | null | null | null | openmmtools/multistate/sams.py | Lnaden/openmmtools | 7a9c61cea5c657e333f433dabbd7c87624f8227f | [
"MIT"
] | null | null | null | openmmtools/multistate/sams.py | Lnaden/openmmtools | 7a9c61cea5c657e333f433dabbd7c87624f8227f | [
"MIT"
] | null | null | null | #!/usr/local/bin/env python
# ==============================================================================
# MODULE DOCSTRING
# ==============================================================================
"""
SamsSampler
===========
Self-adjusted mixture sampling (SAMS), also known as optimally-adjusted mixture ... | 52.759155 | 247 | 0.652927 |
import logging
import numpy as np
import openmmtools as mmtools
from scipy.special import logsumexp
from openmmtools import multistate, utils
from openmmtools.multistate.multistateanalyzer import MultiStateSamplerAnalyzer
import mpiplus
logger = logging.getLogger(__name__)
class SAMSSampler(multistate.MultiSta... | true | true |
08fdb8cdd4f42fdaa2a0fb3833946c8eb61d9373 | 624 | py | Python | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-google.cloud.bigquery.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 12 | 2020-12-15T15:12:06.000Z | 2022-03-18T16:17:42.000Z | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-google.cloud.bigquery.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-google.cloud.bigquery.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 10 | 2020-12-15T15:12:14.000Z | 2022-02-09T21:02:17.000Z | # ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPD... | 36.705882 | 68 | 0.572115 |
from PyInstaller.utils.hooks import copy_metadata
datas = (copy_metadata('google-cloud-bigquery') +
copy_metadata('requests'))
| true | true |
08fdb922549eeedcc8a3d5cca7b43a00df330cdb | 7,470 | py | Python | nipyapi/nifi/models/bulletin_entity.py | esecules/nipyapi | e8a53b79a5e1a6b29446f43d2b23b6a3e60873f1 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/bulletin_entity.py | esecules/nipyapi | e8a53b79a5e1a6b29446f43d2b23b6a3e60873f1 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/bulletin_entity.py | esecules/nipyapi | e8a53b79a5e1a6b29446f43d2b23b6a3e60873f1 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 26.302817 | 479 | 0.559438 |
from pprint import pformat
from six import iteritems
import re
class BulletinEntity(object):
swagger_types = {
'id': 'int',
'group_id': 'str',
'source_id': 'str',
'timestamp': 'str',
'node_address': 'str',
'can_read': 'bool',
'bulletin': 'BulletinDTO'
... | true | true |
08fdb980dda6a63afc69290cabeff218bbef04a0 | 10,513 | py | Python | linter.py | TomasBarry/SublimeLinter-pylint | c8957903a8d2fd014597fad956e7c22d90286369 | [
"MIT"
] | null | null | null | linter.py | TomasBarry/SublimeLinter-pylint | c8957903a8d2fd014597fad956e7c22d90286369 | [
"MIT"
] | null | null | null | linter.py | TomasBarry/SublimeLinter-pylint | c8957903a8d2fd014597fad956e7c22d90286369 | [
"MIT"
] | null | null | null | import logging
import re
from SublimeLinter.lint import PythonLinter
logger = logging.getLogger('SublimeLinter.plugins.pylint')
class Pylint(PythonLinter):
regex = (
r'^(?P<line>\d+):(?P<col>\d+):'
r'(?P<code>(?:(?P<error>[FE]\d+)|(?P<warning>[CIWR]\d+))): '
r'(?P<message>.*?)(?:\r?$)'
... | 36.630662 | 114 | 0.511652 | import logging
import re
from SublimeLinter.lint import PythonLinter
logger = logging.getLogger('SublimeLinter.plugins.pylint')
class Pylint(PythonLinter):
regex = (
r'^(?P<line>\d+):(?P<col>\d+):'
r'(?P<code>(?:(?P<error>[FE]\d+)|(?P<warning>[CIWR]\d+))): '
r'(?P<message>.*?)(?:\r?$)'
... | true | true |
08fdb9d5f2f19a853e6a98d50b8841f64e1ba5d9 | 8,704 | py | Python | example/simple_multiview.py | tu-rbo/concarne | 0e9ae1fa21e132bd240b23e116e7f21e8c45735b | [
"MIT"
] | 16 | 2016-01-04T15:46:16.000Z | 2021-01-26T14:16:36.000Z | example/simple_multiview.py | tu-rbo/concarne | 0e9ae1fa21e132bd240b23e116e7f21e8c45735b | [
"MIT"
] | 1 | 2017-01-04T19:28:49.000Z | 2017-01-04T21:45:04.000Z | example/simple_multiview.py | tu-rbo/concarne | 0e9ae1fa21e132bd240b23e116e7f21e8c45735b | [
"MIT"
] | 4 | 2016-05-27T14:43:32.000Z | 2018-03-23T00:24:42.000Z | # -*- coding: utf-8 -*-
"""
This example illustrates how simple it is to train a classifier using
side information.
It illustrates the exemplary use of the multi-view pattern; for more info
on how to use other patterns, check out synthetic.py.
For a realistic example with real data check out handwritten.py.
For mo... | 42.458537 | 124 | 0.576057 |
from __future__ import print_function
import concarne
import concarne.patterns
import concarne.training
import lasagne
import theano.tensor as T
try:
import sklearn.linear_model as sklm
except:
print (
"""You don't have scikit-learn installed; install it to compare
learning with side information to simple ... | true | true |
08fdbb228aa5a80070551a4381b7b756e73f07de | 5,785 | py | Python | src/main/python/apache/thermos/core/muxer.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | 1 | 2016-05-01T20:17:24.000Z | 2016-05-01T20:17:24.000Z | src/main/python/apache/thermos/core/muxer.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | src/main/python/apache/thermos/core/muxer.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2013 Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 36.15625 | 95 | 0.677442 |
import os
import errno
from gen.apache.thermos.ttypes import RunnerCkpt
from twitter.common import log
from twitter.common.recordio import ThriftRecordReader
class ProcessMuxer(object):
class ProcessExists(Exception): pass
class ProcessNotFound(Exception): pass
class CorruptCheckpoint(Exception): pass
def... | true | true |
08fdbc0e3569bdf29bfe2a9edbd0085caed4e1e4 | 3,896 | py | Python | core/bigchaindb/backend/schema.py | BDNTeam/DDC | b8440913e95227a58afdbe3f3a4aa8cde1b1496d | [
"Apache-2.0"
] | 1 | 2018-11-06T10:42:17.000Z | 2018-11-06T10:42:17.000Z | core/bigchaindb/backend/schema.py | BDNTeam/DDC | b8440913e95227a58afdbe3f3a4aa8cde1b1496d | [
"Apache-2.0"
] | null | null | null | core/bigchaindb/backend/schema.py | BDNTeam/DDC | b8440913e95227a58afdbe3f3a4aa8cde1b1496d | [
"Apache-2.0"
] | null | null | null | # Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Database creation and schema-providing interfaces for backends."""
from functools import singledispatch
import logging
import bigchaindb
from bigchaindb.backend... | 30.920635 | 81 | 0.649897 |
from functools import singledispatch
import logging
import bigchaindb
from bigchaindb.backend.connection import connect
from bigchaindb.common.exceptions import ValidationError
from bigchaindb.common.utils import validate_all_values_for_key
logger = logging.getLogger(__name__)
TABLES = ('transactions', 'blocks', '... | true | true |
08fdbe447bb458eccb887efc4d6e0520184ce763 | 1,392 | py | Python | py/695. Max Area of Island.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/695. Max Area of Island.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/695. Max Area of Island.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/max-area-of-island/
# You are given an m x n binary matrix grid. An island is a group of 1's
# (representing land) connected 4-directionally (horizontal or vertical.) You may
# assume all four edges of the grid are surrounded by water.
# The area of an island is the number of cells wit... | 34.8 | 81 | 0.524425 |
# (representing land) connected 4-directionally (horizontal or vertical.) You may
# assume all four edges of the grid are surrounded by water.
# The area of an island is the number of cells with a value 1 in the island.
# Return the maximum area of an island in grid. If there is no island, return 0.
###############... | true | true |
08fdbe59d5523d1f2936a4544aaca6e7599bab38 | 18,527 | py | Python | tests/tensor/test_sort.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | 1 | 2020-12-30T19:12:52.000Z | 2020-12-30T19:12:52.000Z | tests/tensor/test_sort.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | tests/tensor/test_sort.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | 1 | 2020-08-15T17:09:10.000Z | 2020-08-15T17:09:10.000Z | from functools import reduce
from itertools import chain, product
import numpy as np
import pytest
import theano
from tests import unittest_tools as utt
from theano import tensor
from theano.tensor.sort import (
ArgSortOp,
SortOp,
TopKOp,
argsort,
argtopk,
sort,
topk,
topk_and_argtopk,... | 35.289524 | 138 | 0.557133 | from functools import reduce
from itertools import chain, product
import numpy as np
import pytest
import theano
from tests import unittest_tools as utt
from theano import tensor
from theano.tensor.sort import (
ArgSortOp,
SortOp,
TopKOp,
argsort,
argtopk,
sort,
topk,
topk_and_argtopk,... | true | true |
08fdbfa81e9c55aefe178be4971df5e0efb70e16 | 2,195 | py | Python | library/source1/bsp/lumps/displacement_lump.py | anderlli0053/SourceIO | 3c0c4839939ce698439987ac52154f89ee2f5341 | [
"MIT"
] | 199 | 2019-04-02T02:30:58.000Z | 2022-03-30T21:29:49.000Z | library/source1/bsp/lumps/displacement_lump.py | anderlli0053/SourceIO | 3c0c4839939ce698439987ac52154f89ee2f5341 | [
"MIT"
] | 113 | 2019-03-03T19:36:25.000Z | 2022-03-31T19:44:05.000Z | library/source1/bsp/lumps/displacement_lump.py | anderlli0053/SourceIO | 3c0c4839939ce698439987ac52154f89ee2f5341 | [
"MIT"
] | 38 | 2019-05-15T16:49:30.000Z | 2022-03-22T03:40:43.000Z | from typing import List
import numpy as np
from . import SteamAppId
from .. import Lump, lump_tag
from ..datatypes.displacement import DispInfo, VDispInfo
@lump_tag(26, 'LUMP_DISPINFO')
class DispInfoLump(Lump):
def __init__(self, bsp, lump_id):
super().__init__(bsp, lump_id)
self.infos: List[Di... | 27.098765 | 85 | 0.608656 | from typing import List
import numpy as np
from . import SteamAppId
from .. import Lump, lump_tag
from ..datatypes.displacement import DispInfo, VDispInfo
@lump_tag(26, 'LUMP_DISPINFO')
class DispInfoLump(Lump):
def __init__(self, bsp, lump_id):
super().__init__(bsp, lump_id)
self.infos: List[Di... | true | true |
08fdbfe83b3583eacf17b1c69506ac233a4dcd18 | 1,712 | py | Python | tests/test_posrec_neuralnet.py | jacr20/pax | d64d0ae4e4ec3e9bb3e61065ed92e9ea23328940 | [
"BSD-3-Clause"
] | 17 | 2016-04-24T12:02:03.000Z | 2021-07-19T19:39:47.000Z | tests/test_posrec_neuralnet.py | jacr20/pax | d64d0ae4e4ec3e9bb3e61065ed92e9ea23328940 | [
"BSD-3-Clause"
] | 300 | 2016-04-01T15:29:57.000Z | 2021-01-03T23:59:45.000Z | tests/test_posrec_neuralnet.py | jacr20/pax | d64d0ae4e4ec3e9bb3e61065ed92e9ea23328940 | [
"BSD-3-Clause"
] | 20 | 2016-04-14T15:11:26.000Z | 2021-09-18T06:39:09.000Z | import unittest
import numpy as np
from pax import core, plugin
from pax.datastructure import Event, Peak
class TestPosRecNeuralNet(unittest.TestCase):
def setUp(self):
self.pax = core.Processor(config_names='XENON100', just_testing=True, config_dict={'pax': {
'plugin_group_names': ['test'],... | 33.568627 | 99 | 0.605724 | import unittest
import numpy as np
from pax import core, plugin
from pax.datastructure import Event, Peak
class TestPosRecNeuralNet(unittest.TestCase):
def setUp(self):
self.pax = core.Processor(config_names='XENON100', just_testing=True, config_dict={'pax': {
'plugin_group_names': ['test'],... | true | true |
08fdbfe9424191a0c78dfdb3bf39db030776744c | 4,511 | py | Python | sistema/models.py | gabrielf10/webAmpunc | 69237703d64b174c29c78908320cc572366736aa | [
"BSD-3-Clause"
] | null | null | null | sistema/models.py | gabrielf10/webAmpunc | 69237703d64b174c29c78908320cc572366736aa | [
"BSD-3-Clause"
] | null | null | null | sistema/models.py | gabrielf10/webAmpunc | 69237703d64b174c29c78908320cc572366736aa | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.core.validators import MinValueValidator
from decimal import *
#from sistema import utilerias
class Socio(models.Model):
nombre = models.CharField(max_length=255)
apellido = models.CharField(max_length=255)
slug = models.SlugFie... | 30.47973 | 125 | 0.765241 | from django.db import models
from django.core.validators import MinValueValidator
from decimal import *
class Socio(models.Model):
nombre = models.CharField(max_length=255)
apellido = models.CharField(max_length=255)
slug = models.SlugField(
max_length=60, blank=True, null=True, editable=False)
direccion = mode... | true | true |
08fdbfef224592573f0e02d18b959f20db764016 | 16,282 | py | Python | gem/management/commands/migrate_surveys_to_forms.py | praekelt/molo-gem | ab4f9a16719f6cfc1981ef448f1d42c457e1dad7 | [
"BSD-2-Clause"
] | 3 | 2017-08-03T22:37:13.000Z | 2018-06-14T15:36:01.000Z | gem/management/commands/migrate_surveys_to_forms.py | praekelt/molo-gem | ab4f9a16719f6cfc1981ef448f1d42c457e1dad7 | [
"BSD-2-Clause"
] | 635 | 2016-01-12T07:23:46.000Z | 2018-11-16T07:43:13.000Z | gem/management/commands/migrate_surveys_to_forms.py | praekelt/molo-gem | ab4f9a16719f6cfc1981ef448f1d42c457e1dad7 | [
"BSD-2-Clause"
] | 6 | 2017-05-11T09:50:34.000Z | 2018-11-16T10:42:56.000Z | from django.core.management.base import BaseCommand
from wagtail_personalisation.models import Segment
from molo.core.models import Main, FooterPage
from molo.surveys.models import (
MoloSurveyPage, SurveysIndexPage, MoloSurveyFormField,
MoloSurveyPageView, MoloSurveySubmission,
PersonalisableSurvey, Person... | 47.888235 | 79 | 0.549748 | from django.core.management.base import BaseCommand
from wagtail_personalisation.models import Segment
from molo.core.models import Main, FooterPage
from molo.surveys.models import (
MoloSurveyPage, SurveysIndexPage, MoloSurveyFormField,
MoloSurveyPageView, MoloSurveySubmission,
PersonalisableSurvey, Person... | true | true |
08fdc146452c6d2de38c6d173f333a4873a0187f | 4,034 | py | Python | eu-structural-funds/common/processors/MT/mt_malta_scraper.py | transpresupuestaria/os-data-importers | 929e07aefc98ae4788e75c682d4c3adc014bf6ce | [
"MIT"
] | null | null | null | eu-structural-funds/common/processors/MT/mt_malta_scraper.py | transpresupuestaria/os-data-importers | 929e07aefc98ae4788e75c682d4c3adc014bf6ce | [
"MIT"
] | null | null | null | eu-structural-funds/common/processors/MT/mt_malta_scraper.py | transpresupuestaria/os-data-importers | 929e07aefc98ae4788e75c682d4c3adc014bf6ce | [
"MIT"
] | null | null | null | """A scraper for Malta 2007-2013."""
from datapackage_pipelines.wrapper import spew, ingest
from logging import info, debug
from lxml.html import fromstring
from requests import Session
BASE_URL = 'https://investinginyourfuture.gov.mt'
PAGINATION_URL = BASE_URL + '/ajax/loadProjects.ashx?page={counter}'
PROJECT_URLS_... | 45.840909 | 174 | 0.746901 |
from datapackage_pipelines.wrapper import spew, ingest
from logging import info, debug
from lxml.html import fromstring
from requests import Session
BASE_URL = 'https://investinginyourfuture.gov.mt'
PAGINATION_URL = BASE_URL + '/ajax/loadProjects.ashx?page={counter}'
PROJECT_URLS_XPATH = './/div[@class="project-listi... | true | true |
08fdc2d0b9db42ad75e29aba5c4b738f49dcb9f4 | 3,923 | py | Python | tests/parsers/winreg_plugins/typedurls.py | pyllyukko/plaso | 7533db2d1035ca71d264d6281ebd5db2d073c587 | [
"Apache-2.0"
] | 2 | 2019-10-23T03:37:59.000Z | 2020-08-14T17:09:26.000Z | tests/parsers/winreg_plugins/typedurls.py | pyllyukko/plaso | 7533db2d1035ca71d264d6281ebd5db2d073c587 | [
"Apache-2.0"
] | null | null | null | tests/parsers/winreg_plugins/typedurls.py | pyllyukko/plaso | 7533db2d1035ca71d264d6281ebd5db2d073c587 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the MSIE typed URLs Windows Registry plugin."""
import unittest
from plaso.parsers.winreg_plugins import typedurls
from tests.parsers.winreg_plugins import test_lib
class MsieTypedURLsPluginTest(test_lib.RegistryPluginTestCase):
"""Tests for the MSIE ty... | 33.818966 | 77 | 0.686719 |
import unittest
from plaso.parsers.winreg_plugins import typedurls
from tests.parsers.winreg_plugins import test_lib
class MsieTypedURLsPluginTest(test_lib.RegistryPluginTestCase):
def testFilters(self):
plugin = typedurls.TypedURLsPlugin()
key_path = (
'HKEY_CURRENT_USER\\Software\\Microsoft\\... | true | true |
08fdc32492611af511133d9f4f55720f64107876 | 3,701 | py | Python | kuplii2015/models.py | wyrmiyu/kompassi | e089a235bcd74b6a31b34572a56f4947bebc5e60 | [
"MIT"
] | null | null | null | kuplii2015/models.py | wyrmiyu/kompassi | e089a235bcd74b6a31b34572a56f4947bebc5e60 | [
"MIT"
] | null | null | null | kuplii2015/models.py | wyrmiyu/kompassi | e089a235bcd74b6a31b34572a56f4947bebc5e60 | [
"MIT"
] | null | null | null | # encoding: utf-8
from django.db import models
from labour.models import SignupExtraBase
from labour.querybuilder import QueryBuilder, add_prefix
from core.utils import validate_slug
SHIFT_TYPE_CHOICES = [
(u'2h', '2 tunnin vuoroja'),
(u'4h', '4 tunnin vuoroja'),
(u'yli4h', 'Yli 4 tunnin vuoroja'),
]
... | 33.044643 | 214 | 0.65685 |
from django.db import models
from labour.models import SignupExtraBase
from labour.querybuilder import QueryBuilder, add_prefix
from core.utils import validate_slug
SHIFT_TYPE_CHOICES = [
(u'2h', '2 tunnin vuoroja'),
(u'4h', '4 tunnin vuoroja'),
(u'yli4h', 'Yli 4 tunnin vuoroja'),
]
TOTAL_WORK_CHOICE... | true | true |
08fdc325e7744b37ef11bdc9525112f361adcb47 | 8,386 | py | Python | python_modules/dagster/dagster/core/system_config/objects.py | danieldiamond/dagster | d8de290f2ac6fa59d4e69a7e88d7703c31fcd3ea | [
"Apache-2.0"
] | 1 | 2020-12-20T18:39:17.000Z | 2020-12-20T18:39:17.000Z | python_modules/dagster/dagster/core/system_config/objects.py | danieldiamond/dagster | d8de290f2ac6fa59d4e69a7e88d7703c31fcd3ea | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/system_config/objects.py | danieldiamond/dagster | d8de290f2ac6fa59d4e69a7e88d7703c31fcd3ea | [
"Apache-2.0"
] | null | null | null | '''System-provided config objects and constructors.'''
from collections import namedtuple
from dagster import check
from dagster.core.definitions.pipeline import PipelineDefinition
from dagster.core.definitions.run_config_schema import create_environment_type
from dagster.core.errors import DagsterInvalidConfigError
f... | 40.317308 | 109 | 0.674219 | from collections import namedtuple
from dagster import check
from dagster.core.definitions.pipeline import PipelineDefinition
from dagster.core.definitions.run_config_schema import create_environment_type
from dagster.core.errors import DagsterInvalidConfigError
from dagster.utils import ensure_single_item
class Sol... | true | true |
08fdc33f6e0c640ca8e4bb180c77703c3435f165 | 3,781 | py | Python | contrib/macdeploy/custom_dsstore.py | irlecoin/irle | a79e92dbb2d28739510019e91079fcc5b4a633dd | [
"MIT"
] | 3 | 2018-06-25T12:07:24.000Z | 2018-06-25T12:11:58.000Z | contrib/macdeploy/custom_dsstore.py | irlecoin/irle | a79e92dbb2d28739510019e91079fcc5b4a633dd | [
"MIT"
] | 2 | 2018-06-26T01:20:50.000Z | 2019-04-10T21:20:11.000Z | contrib/macdeploy/custom_dsstore.py | irlecoin/irle | a79e92dbb2d28739510019e91079fcc5b4a633dd | [
"MIT"
] | 2 | 2018-06-25T12:07:27.000Z | 2018-06-25T12:12:02.000Z | #!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | 61.983607 | 1,817 | 0.72785 | from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv[1]
package_name_ns = sys.argv[2]
ds = DSStore.open(output_file, 'w+')
ds['.']['bwsp'] = {
'ShowStatusBar': False,
'WindowBounds': b'{{300, 2... | true | true |
08fdc5df41b38df0d12ef9e4440909ea6cac7bb8 | 6,724 | py | Python | 08_Convolutional_Neural_Networks/05_Stylenet_NeuralStyle/05_stylenet.py | varunjha089/tensorflow_cookbook | c1fa5051c860ecb6de875db975465ced06f43ba6 | [
"MIT"
] | 93 | 2018-05-27T08:07:02.000Z | 2022-02-28T11:18:08.000Z | 08_Convolutional_Neural_Networks/05_Stylenet_NeuralStyle/05_stylenet.py | varunjha089/tensorflow_cookbook | c1fa5051c860ecb6de875db975465ced06f43ba6 | [
"MIT"
] | 2 | 2018-03-07T14:31:22.000Z | 2018-03-07T15:04:17.000Z | 08_Convolutional_Neural_Networks/05_Stylenet_NeuralStyle/05_stylenet.py | varunjha089/tensorflow_cookbook | c1fa5051c860ecb6de875db975465ced06f43ba6 | [
"MIT"
] | 75 | 2018-06-22T08:02:03.000Z | 2022-03-10T14:38:44.000Z | # Using TensorFlow for Stylenet/NeuralStyle
#---------------------------------------
#
# We use two images, an original image and a style image
# and try to make the original image in the style of the style image.
#
# Reference paper:
# https://arxiv.org/abs/1508.06576
#
# Need to download the model 'imagenet-vgg-veryd... | 35.765957 | 121 | 0.685901 |
import scipy.io
import scipy.misc
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
ops.reset_default_graph()
sess = tf.Session()
original_image_file = '../images/book_cover.jpg'
style_image_file = '../images/starry_night.jpg'
vgg_path = 'imagenet-vgg-verydeep-19.mat'
origina... | true | true |
08fdc65790f2c31d2ceb05d963175d8508afd9b6 | 4,446 | py | Python | src/azure-cli-core/azure/cli/core/extension/_resolve.py | xaliciayang/azure-cli | 38c80c875e8a79d08d06a2f42ec82fd54934343e | [
"MIT"
] | 4 | 2016-08-23T06:19:01.000Z | 2018-03-20T22:47:15.000Z | src/azure-cli-core/azure/cli/core/extension/_resolve.py | xaliciayang/azure-cli | 38c80c875e8a79d08d06a2f42ec82fd54934343e | [
"MIT"
] | 120 | 2018-03-27T19:14:40.000Z | 2020-12-10T23:53:35.000Z | src/azure-cli-core/azure/cli/core/extension/_resolve.py | xaliciayang/azure-cli | 38c80c875e8a79d08d06a2f42ec82fd54934343e | [
"MIT"
] | 11 | 2018-08-23T21:31:06.000Z | 2020-09-03T21:39:51.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.166667 | 114 | 0.679037 | from pkg_resources import parse_version
from azure.cli.core.extension import ext_compat_with_cli, WHEEL_INFO_RE
from azure.cli.core.extension._index import get_index_extensions
from knack.log import get_logger
from knack.util import CLIError
logger = get_logger(__name__)
class NoExtensionCandidatesError(Exception)... | true | true |
08fdc681675e5b958c487e227de3abe0803be071 | 1,634 | py | Python | neutron/agent/common/utils.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 1 | 2016-03-25T21:13:13.000Z | 2016-03-25T21:13:13.000Z | neutron/agent/common/utils.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-27T00:48:55.000Z | 2015-04-21T05:29:37.000Z | neutron/agent/common/utils.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-26T00:55:17.000Z | 2020-03-01T17:05:40.000Z | # Copyright 2015 Cloudbase Solutions.
# 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 requ... | 29.178571 | 78 | 0.728886 |
import os
from oslo_config import cfg
from oslo_log import log as logging
from neutron._i18n import _LE
from neutron.agent.common import config
from neutron.common import utils as neutron_utils
if os.name == 'nt':
from neutron.agent.windows import utils
else:
from neutron.agent.linux import utils
LOG = l... | true | true |
08fdc6892b66bc33ccd798d276b5bfcfe0e2b044 | 1,274 | py | Python | Python/Summary Ranges/Solution.py | samlaudev/LeetCode | a41395eb116ca2f7662752f05dddc66a1871e501 | [
"MIT"
] | null | null | null | Python/Summary Ranges/Solution.py | samlaudev/LeetCode | a41395eb116ca2f7662752f05dddc66a1871e501 | [
"MIT"
] | null | null | null | Python/Summary Ranges/Solution.py | samlaudev/LeetCode | a41395eb116ca2f7662752f05dddc66a1871e501 | [
"MIT"
] | null | null | null | # Problem: Summary Ranges
#
# Given a sorted integer array without duplicates, return the summary of its ranges.
#
# For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].
#
################################################################################
class Solution(object):
def summaryRanges(self, nums)... | 28.311111 | 84 | 0.456044 |
class Solution(object):
def summaryRanges(self, nums):
if not len(nums):
return []
start, current, result = 0, nums[0], []
for i in range(len(nums)):
if nums[i] == current:
current += 1
else:
if i - 1 > start:
... | true | true |
08fdc6ac607101a0e498fedc01912403af5a5e16 | 250 | py | Python | classwork1/pollsapp/models.py | cs-fullstack-2019-spring/django-models3-cw-cierravereen24 | 930e4d5adcae4a591b4618e1a37d3fab46430561 | [
"Apache-2.0"
] | null | null | null | classwork1/pollsapp/models.py | cs-fullstack-2019-spring/django-models3-cw-cierravereen24 | 930e4d5adcae4a591b4618e1a37d3fab46430561 | [
"Apache-2.0"
] | null | null | null | classwork1/pollsapp/models.py | cs-fullstack-2019-spring/django-models3-cw-cierravereen24 | 930e4d5adcae4a591b4618e1a37d3fab46430561 | [
"Apache-2.0"
] | null | null | null | from django.db import models
# Create your models here.
class Book(models.Model):
name = models.CharField(max_length=100)
pageNumber = models.IntegerField()
genre = models.CharField(max_length=100)
PublishDate = models.DateField()
| 22.727273 | 44 | 0.732 | from django.db import models
class Book(models.Model):
name = models.CharField(max_length=100)
pageNumber = models.IntegerField()
genre = models.CharField(max_length=100)
PublishDate = models.DateField()
| true | true |
08fdc8a07104e20cb0cb9781ae945bd930fabcc5 | 6,074 | py | Python | tests/cigar_example/cigar_example/settings.py | KitchenStories/django-rest-swagger | 4262cb5156285adcdf661d5204d45eefd269aaca | [
"BSD-2-Clause"
] | 1 | 2017-06-09T23:37:29.000Z | 2017-06-09T23:37:29.000Z | tests/cigar_example/cigar_example/settings.py | KitchenStories/django-rest-swagger | 4262cb5156285adcdf661d5204d45eefd269aaca | [
"BSD-2-Clause"
] | 9 | 2020-06-05T17:07:13.000Z | 2022-01-13T00:36:30.000Z | tests/cigar_example/cigar_example/settings.py | KitchenStories/django-rest-swagger | 4262cb5156285adcdf661d5204d45eefd269aaca | [
"BSD-2-Clause"
] | null | null | null | # Django settings for cigar_example project.
from os.path import dirname, abspath, join
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
def root(*x):
return abspath(join(abspath(DJANGO_ROOT), *x))
DATABASES = {
'default': {
'ENG... | 32.308511 | 109 | 0.695917 | from os.path import dirname, abspath, join
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
def root(*x):
return abspath(join(abspath(DJANGO_ROOT), *x))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', ... | true | true |
08fdc8f626aa27b936f6596f5e2dbd62d699cf70 | 3,179 | py | Python | parser.py | drholera/olx-parser | 837166bca48b39e03bc1987c9ebb2511697fe3fd | [
"MIT"
] | null | null | null | parser.py | drholera/olx-parser | 837166bca48b39e03bc1987c9ebb2511697fe3fd | [
"MIT"
] | 3 | 2020-04-05T09:26:01.000Z | 2020-04-05T13:00:14.000Z | parser.py | drholera/olx-parser | 837166bca48b39e03bc1987c9ebb2511697fe3fd | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
import pandas as pd
import webbrowser
import os
import io
class Parser(object):
__url = ''
__results = []
def __init__(self):
search_query = input("Please, enter your search query \n")
self.__url = 'https://www.olx.ua/list/q-' + search_query.r... | 34.934066 | 116 | 0.538534 | import requests
from bs4 import BeautifulSoup
import pandas as pd
import webbrowser
import os
import io
class Parser(object):
__url = ''
__results = []
def __init__(self):
search_query = input("Please, enter your search query \n")
self.__url = 'https://www.olx.ua/list/q-' + search_query.r... | true | true |
08fdc9232eb804841b4a786149b9da0fe7e40ac8 | 190 | py | Python | examples/retrieval/evaluation/reranking/download_model.py | gabinguo/beir | 1d7f7168fc9c804b561a3fb25c330bde7263c085 | [
"Apache-2.0"
] | null | null | null | examples/retrieval/evaluation/reranking/download_model.py | gabinguo/beir | 1d7f7168fc9c804b561a3fb25c330bde7263c085 | [
"Apache-2.0"
] | null | null | null | examples/retrieval/evaluation/reranking/download_model.py | gabinguo/beir | 1d7f7168fc9c804b561a3fb25c330bde7263c085 | [
"Apache-2.0"
] | null | null | null | from beir.reranking.models import CrossEncoder
from beir.configs import default_ranker
cross_encoder_model = CrossEncoder(default_ranker)
cross_encoder_model.model.save("./default_ranker")
| 31.666667 | 50 | 0.857895 | from beir.reranking.models import CrossEncoder
from beir.configs import default_ranker
cross_encoder_model = CrossEncoder(default_ranker)
cross_encoder_model.model.save("./default_ranker")
| true | true |
08fdcac9de375c9b830a445e140a6c6954dff521 | 3,882 | py | Python | markdown_generator/talks.py | gdevenyi/gabriel.devenyi.ca | cc001f1dc6ed07ff46c3b5cca66865b977710acc | [
"MIT"
] | null | null | null | markdown_generator/talks.py | gdevenyi/gabriel.devenyi.ca | cc001f1dc6ed07ff46c3b5cca66865b977710acc | [
"MIT"
] | 4 | 2021-08-20T14:16:59.000Z | 2021-08-20T14:25:50.000Z | markdown_generator/talks.py | gdevenyi/gdevenyi.github.io | cc001f1dc6ed07ff46c3b5cca66865b977710acc | [
"MIT"
] | null | null | null | # coding: utf-8
# # Talks markdown generator for academicpages
#
# Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_... | 36.971429 | 420 | 0.665636 |
# In[1]:
import pandas as pd
import os
# ## Data format
#
# The TSV needs to have the following columns: title, type, url_slug, venue, date, location, talk_url, description, with a header at the top. Many of these fields can be blank, but the columns must be in the TSV.
#
# - Fields that cannot be blank: `title`, ... | true | true |
08fdcb319c8c3ba93c8111f018f13dceb29dc8e6 | 21,440 | py | Python | python/raspberrypi/DFRobot_RTU.py | cdjq/DFRobot_RTU | e4d028756bf152feb5b31ae6cc602de3fe69fa6a | [
"MIT"
] | null | null | null | python/raspberrypi/DFRobot_RTU.py | cdjq/DFRobot_RTU | e4d028756bf152feb5b31ae6cc602de3fe69fa6a | [
"MIT"
] | null | null | null | python/raspberrypi/DFRobot_RTU.py | cdjq/DFRobot_RTU | e4d028756bf152feb5b31ae6cc602de3fe69fa6a | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
'''
@file DFRobot_RTU.py
@brief Modbus RTU libary for Arduino.
@copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
@licence The MIT License (MIT)
@author [Arya](xue.peng@dfrobot.com)
@version V1.0
@date 2021-07-16
@https://github.com/DFRobot/DFRobot_... | 39.557196 | 139 | 0.583116 |
import sys
import serial
import time
class DFRobot_RTU(object):
_packet_header = {"id": 0, "cmd": 1, "cs": 0}
eRTU_EXCEPTION_ILLEGAL_FUNCTION = 0x01
eRTU_EXCEPTION_ILLEGAL_DATA_ADDRESS = 0x02
eRTU_EXCEPTION_ILLEGAL_DATA_VALUE = 0x03
eRTU_EXCEPTION_SLAVE_FAILURE = 0x04
eRTU_EXCEPTION_CRC... | true | true |
08fdcb44ae5aa545221ce9a57338bf96d41dfc51 | 1,198 | py | Python | asyncio_mqtt/error.py | oholsen/asyncio-mqtt | 1da54b913e96ea2b3b5a8ed87ae1d4d1e4f350a7 | [
"BSD-3-Clause"
] | null | null | null | asyncio_mqtt/error.py | oholsen/asyncio-mqtt | 1da54b913e96ea2b3b5a8ed87ae1d4d1e4f350a7 | [
"BSD-3-Clause"
] | null | null | null | asyncio_mqtt/error.py | oholsen/asyncio-mqtt | 1da54b913e96ea2b3b5a8ed87ae1d4d1e4f350a7 | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
class MqttError(Exception):
"""Base exception for all asyncio-mqtt exceptions."""
pass
class MqttCodeError(MqttError):
def __init__(self, rc, *args):
super().__init__(*args)
self.rc = rc
def __str__(self):
return f'[code:{self.rc}] ... | 29.95 | 102 | 0.646912 |
class MqttError(Exception):
pass
class MqttCodeError(MqttError):
def __init__(self, rc, *args):
super().__init__(*args)
self.rc = rc
def __str__(self):
return f'[code:{self.rc}] {super().__str__()}'
class MqttConnectError(MqttCodeError):
def __init__(self, rc):
m... | true | true |
08fdcbc6dabf12a09b91f582cc0d1a0911993f39 | 1,264 | py | Python | src/pymortests/core/logger.py | TiKeil/pymor | 5c6b3b6e1714b5ede11ce7cf03399780ab29d252 | [
"Unlicense"
] | 1 | 2020-12-31T18:45:48.000Z | 2020-12-31T18:45:48.000Z | src/pymortests/core/logger.py | TreeerT/pymor | e8b18d2d4c4b5998f0bd84f6728e365e0693b753 | [
"Unlicense"
] | null | null | null | src/pymortests/core/logger.py | TreeerT/pymor | e8b18d2d4c4b5998f0bd84f6728e365e0693b753 | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import logging
import pymor.core as core
from pymor.core.logger import log_levels
from pymor.oper... | 30.829268 | 85 | 0.705696 |
import logging
import pymor.core as core
from pymor.core.logger import log_levels
from pymor.operators.numpy import NumpyMatrixOperator
from pymortests.base import (runmodule,)
def test_logger():
logger = NumpyMatrixOperator._logger
for lvl in [getattr(logging, lvl) for lvl in ['WARN', 'ERROR', 'DEBUG', 'IN... | true | true |
08fdcbfa9844642845ab70f096959eeffdc6c573 | 1,255 | py | Python | Easy/461.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 6 | 2017-09-25T18:05:50.000Z | 2019-03-27T00:23:15.000Z | Easy/461.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 1 | 2017-10-29T12:04:41.000Z | 2018-08-16T18:00:37.000Z | Easy/461.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | null | null | null | # ------------------------------
# 461. Hamming Distance
#
# Description:
# The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
# Given two integers x and y, calculate the Hamming distance.
# Note:
# 0 ≤ x, y < 231.
# Example:
# Input: x = 1, y = 4
# Outp... | 22.818182 | 117 | 0.459761 |
class Solution(object):
def hammingDistance(self, x, y):
xs = bin(x)[2:]
ys = bin(y)[2:]
i = len(xs) - 1
j = len(ys) - 1
res = 0
while i >= 0 and j >= 0:
res += int(xs[i]) ^ int(ys[j])
i -= 1
j -= 1
if i >... | true | true |
08fdcd30b27078f13eb810f567f65b131d59bed7 | 1,475 | py | Python | tests/test_action_interface_remove_port_channel.py | cognifloyd/stackstorm-vdx | 0ae8b783cdc3e3fe467050268ea7d10de493e3ca | [
"Apache-2.0"
] | 164 | 2015-01-17T16:08:33.000Z | 2021-08-03T02:34:07.000Z | tests/test_action_interface_remove_port_channel.py | cognifloyd/stackstorm-vdx | 0ae8b783cdc3e3fe467050268ea7d10de493e3ca | [
"Apache-2.0"
] | 442 | 2015-01-01T11:19:01.000Z | 2017-09-06T23:26:17.000Z | tests/test_action_interface_remove_port_channel.py | cognifloyd/stackstorm-vdx | 0ae8b783cdc3e3fe467050268ea7d10de493e3ca | [
"Apache-2.0"
] | 202 | 2015-01-13T00:37:40.000Z | 2020-11-07T11:30:10.000Z | """Generated test for checking pynos based actions
"""
import xml.etree.ElementTree as ET
from st2tests.base import BaseActionTestCase
from interface_remove_port_channel import interface_remove_port_channel
__all__ = [
'TestInterfaceRemovePortChannel'
]
class MockCallback(object): # pylint:disable=too-few-publi... | 27.830189 | 79 | 0.619661 | import xml.etree.ElementTree as ET
from st2tests.base import BaseActionTestCase
from interface_remove_port_channel import interface_remove_port_channel
__all__ = [
'TestInterfaceRemovePortChannel'
]
class MockCallback(object): returned_data = None
def callback(self, call, **kwargs): xml_result... | true | true |
08fdcda14cd2530bcdac7ff3b46fa41a5c89dc90 | 1,184 | py | Python | crisismgmt-api/migrations/versions/d347356e5b51.py | alexadonov/SS3A_Backend | baccedc8737fa5f3b4f268b4c4e833763f74f922 | [
"MIT"
] | null | null | null | crisismgmt-api/migrations/versions/d347356e5b51.py | alexadonov/SS3A_Backend | baccedc8737fa5f3b4f268b4c4e833763f74f922 | [
"MIT"
] | 3 | 2021-09-26T06:30:34.000Z | 2021-10-18T07:10:26.000Z | crisismgmt-api/migrations/versions/d347356e5b51.py | alexadonov/SS3A_Backend | baccedc8737fa5f3b4f268b4c4e833763f74f922 | [
"MIT"
] | null | null | null | """empty message
Revision ID: d347356e5b51
Revises: c4b6629eee26
Create Date: 2021-09-13 12:48:41.719215
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
revision = 'd347356e5b51'
down_revision = 'c4b6629eee26'
branch_labels = None
depends_on = None
def upgrade():
op.creat... | 35.878788 | 117 | 0.715372 | from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
revision = 'd347356e5b51'
down_revision = 'c4b6629eee26'
branch_labels = None
depends_on = None
def upgrade():
op.create_table('request_list',
sa.Column('request_list_id', (sa.Integer()), autoincrement=True, nullable=False), ... | true | true |
08fdcdd791d75e0d086fe2de674d06e41f03205c | 794 | py | Python | backend/technews/urls.py | JohnVict0r/tech-news | eceafa020c5ace719c7a32bfc24b911e173dca0e | [
"MIT"
] | 2 | 2020-01-20T16:44:19.000Z | 2020-01-20T17:14:46.000Z | backend/technews/urls.py | JohnVict0r/tech-news | eceafa020c5ace719c7a32bfc24b911e173dca0e | [
"MIT"
] | 7 | 2020-06-06T01:17:00.000Z | 2022-02-10T14:26:14.000Z | backend/technews/urls.py | JohnVict0r/tech-news | eceafa020c5ace719c7a32bfc24b911e173dca0e | [
"MIT"
] | null | null | null | """technews URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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')
Class-base... | 34.521739 | 77 | 0.702771 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('tech.urls'))
]
| true | true |
08fdceb7b63333d1edecddc73e79e8b953f2ce12 | 10,031 | py | Python | gym_pcgrl/gym_pcgrl/envs/probs/minecraft/minecraft_3D_maze_prob.py | JiangZehua/control-pcgrl3D | f9b04e65e1cbf70b7306f4df251450d83c6fb2be | [
"MIT"
] | null | null | null | gym_pcgrl/gym_pcgrl/envs/probs/minecraft/minecraft_3D_maze_prob.py | JiangZehua/control-pcgrl3D | f9b04e65e1cbf70b7306f4df251450d83c6fb2be | [
"MIT"
] | null | null | null | gym_pcgrl/gym_pcgrl/envs/probs/minecraft/minecraft_3D_maze_prob.py | JiangZehua/control-pcgrl3D | f9b04e65e1cbf70b7306f4df251450d83c6fb2be | [
"MIT"
] | null | null | null | """
Generate a fully connected top 3D layout where the longest path is greater than a certain threshold.
Paths are measured in terms of the approximate physics of a minecraft player character. The player can move in any of the
four cardinal directions, provided there are two blocks available vertically (for feet and h... | 41.279835 | 125 | 0.649885 | from pdb import set_trace as TT
import numpy as np
from timeit import default_timer as timer
from gym_pcgrl.envs.probs.problem import Problem
from gym_pcgrl.envs.helper_3D import get_path_coords, get_range_reward, get_tile_locations, calc_num_regions, \
calc_longest_path, debug_path, plot_3D_path, run_dijkstra
fr... | true | true |
08fdcee8b2921c17e4ed640af85028f49575aee2 | 1,958 | py | Python | modi/_conn_proc.py | drecali/pymodi | 8edf7269104efca48f65e5a118edc9fd136d6217 | [
"MIT"
] | 1 | 2020-08-20T01:54:35.000Z | 2020-08-20T01:54:35.000Z | modi/_conn_proc.py | drecali/pymodi | 8edf7269104efca48f65e5a118edc9fd136d6217 | [
"MIT"
] | 33 | 2020-07-30T02:23:10.000Z | 2020-08-05T01:58:53.000Z | modi/_conn_proc.py | drecali/pymodi | 8edf7269104efca48f65e5a118edc9fd136d6217 | [
"MIT"
] | null | null | null |
import threading as th
import multiprocessing as mp
from modi.task.conn_task import ConnTask
from modi.task.ser_task import SerTask
from modi.task.can_task import CanTask
from modi.task.spp_task import SppTask
class ConnProc(mp.Process):
def __init__(self, recv_q, send_q, conn_mode, module_uuid, verbose,
... | 27.971429 | 74 | 0.618999 |
import threading as th
import multiprocessing as mp
from modi.task.conn_task import ConnTask
from modi.task.ser_task import SerTask
from modi.task.can_task import CanTask
from modi.task.spp_task import SppTask
class ConnProc(mp.Process):
def __init__(self, recv_q, send_q, conn_mode, module_uuid, verbose,
... | true | true |
08fdcef229a7f8c24ff5fff5b89c3a8ca9a51b78 | 33,690 | py | Python | cyclopeps/tools/mps_tools.py | philliphelms/cyclopeps | f024d827a7412f4d9df10d6b9453c2692b1a74c3 | [
"MIT"
] | null | null | null | cyclopeps/tools/mps_tools.py | philliphelms/cyclopeps | f024d827a7412f4d9df10d6b9453c2692b1a74c3 | [
"MIT"
] | null | null | null | cyclopeps/tools/mps_tools.py | philliphelms/cyclopeps | f024d827a7412f4d9df10d6b9453c2692b1a74c3 | [
"MIT"
] | null | null | null | """
Tools for Matrix Product States
Author: Phillip Helms <phelms@caltech.edu>
Date: July 2019
"""
from cyclopeps.tools.gen_ten import einsum,ones
#from cyclopeps.tools.params import *
from cyclopeps.tools.utils import *
from numpy import float_
import copy
import numpy as np
def calc_site_dims(site,d,mbd,fixed_bd=... | 30.655141 | 127 | 0.556545 |
from cyclopeps.tools.gen_ten import einsum,ones
from cyclopeps.tools.utils import *
from numpy import float_
import copy
import numpy as np
def calc_site_dims(site,d,mbd,fixed_bd=False):
N = len(d)
for i in range(N):
assert d[i] == d[N-(i+1)],'Current limitation: d must be symmetric around c... | true | true |
08fdd02b183e67a1cc5c30f92ffae8c463664ead | 1,665 | py | Python | src/modified_inception_scores/cifar10/extract.py | val-iisc/deligan | 68451c8923650b9239a87efb3b88f04b6969e54b | [
"MIT"
] | 117 | 2017-06-08T01:14:00.000Z | 2021-05-29T04:54:49.000Z | src/modified_inception_scores/cifar10/extract.py | iskangkang/deligan | 68451c8923650b9239a87efb3b88f04b6969e54b | [
"MIT"
] | 8 | 2017-10-27T05:51:47.000Z | 2020-03-08T09:25:52.000Z | src/modified_inception_scores/cifar10/extract.py | iskangkang/deligan | 68451c8923650b9239a87efb3b88f04b6969e54b | [
"MIT"
] | 35 | 2017-06-08T03:14:57.000Z | 2022-02-19T05:50:15.000Z | from tensorflow.python.platform import gfile
import tensorflow as tf
import numpy as np
model = 'model/classify_image_graph_def.pb'
def create_graph():
""""Creates a graph from saved GraphDef file and returns a saver."""
# Creates graph from saved graph_def.pb.
print 'Loading graph...'
with tf.Session... | 33.979592 | 102 | 0.675676 | from tensorflow.python.platform import gfile
import tensorflow as tf
import numpy as np
model = 'model/classify_image_graph_def.pb'
def create_graph():
""""Creates a graph from saved GraphDef file and returns a saver."""
# Creates graph from saved graph_def.pb.
print 'Loading graph...'
with tf.Session... | false | true |
08fdd09ee831994e958796b11b97b221632ef8fd | 7,255 | py | Python | server/utils/parser_helper.py | guigolab/biogenome-portal | a30557ea02cc94b863d646c5ff166fb593134974 | [
"MIT"
] | 1 | 2022-03-29T05:59:53.000Z | 2022-03-29T05:59:53.000Z | server/utils/parser_helper.py | guigolab/biogenome-portal | a30557ea02cc94b863d646c5ff166fb593134974 | [
"MIT"
] | null | null | null | server/utils/parser_helper.py | guigolab/biogenome-portal | a30557ea02cc94b863d646c5ff166fb593134974 | [
"MIT"
] | 2 | 2022-03-03T15:05:57.000Z | 2022-03-24T00:10:18.000Z | import datetime
import re
from db.models import SecondaryOrganism
from utils.constants import CHECKLIST_FIELD_GROUPS,MANIFEST_TO_MODEL
from utils.ena_client import check_taxons_from_NCBI
from flask import current_app as app
def get_sample_values(header,row):
values = {}
for key, cell in zip(header, row):
... | 46.210191 | 152 | 0.638456 | import datetime
import re
from db.models import SecondaryOrganism
from utils.constants import CHECKLIST_FIELD_GROUPS,MANIFEST_TO_MODEL
from utils.ena_client import check_taxons_from_NCBI
from flask import current_app as app
def get_sample_values(header,row):
values = {}
for key, cell in zip(header, row):
... | true | true |
08fdd0ac5974e7cc03a35623048bda62cd4c42e4 | 175 | py | Python | src/mhealth/__init__.py | pymhealth/pymhealth | db09bf60203938ee8ee9cb340ea281c5fe60fcab | [
"MIT"
] | null | null | null | src/mhealth/__init__.py | pymhealth/pymhealth | db09bf60203938ee8ee9cb340ea281c5fe60fcab | [
"MIT"
] | null | null | null | src/mhealth/__init__.py | pymhealth/pymhealth | db09bf60203938ee8ee9cb340ea281c5fe60fcab | [
"MIT"
] | null | null | null | """Test package docstring."""
from . import generic, heart, inertial, location, smartphone, util
__all__ = ['generic', 'heart', 'inertial', 'location', 'smartphone', 'util']
| 35 | 76 | 0.691429 | from . import generic, heart, inertial, location, smartphone, util
__all__ = ['generic', 'heart', 'inertial', 'location', 'smartphone', 'util']
| true | true |
08fdd12f42a8c8d28d1c1eee3822bdfea92692cc | 2,238 | py | Python | scripts/calibrate_camera.py | saegersven/robocup | 3ce18d68d99da43ab12c19417c988bdad38d7373 | [
"MIT"
] | null | null | null | scripts/calibrate_camera.py | saegersven/robocup | 3ce18d68d99da43ab12c19417c988bdad38d7373 | [
"MIT"
] | null | null | null | scripts/calibrate_camera.py | saegersven/robocup | 3ce18d68d99da43ab12c19417c988bdad38d7373 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import glob
import array
import time
import json
image_folder = "img" # str(input("Input image folder: "))
out_file = "test.json" # str(input("Input output file: "))
X = 5
Y = 7
# Termination criteria
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)... | 28.692308 | 79 | 0.626899 | import numpy as np
import cv2
import glob
import array
import time
import json
image_folder = "img" out_file = "test.json"
X = 5
Y = 7
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
objp = np.zeros((X*Y, 3), np.float32)
objp[:, :2] = np.mgrid[0:X, 0:Y].T.reshape(-1, 2)
objpo... | true | true |
08fdd1c26f90b3f2980e0d8b922117be99d0fbd6 | 1,321 | py | Python | testing/algo_bf.py | Ifkarsyah/College-IF2211-24-game-solver | 3028a582d35f0b133d4016e59e6446e51789ad38 | [
"MIT"
] | null | null | null | testing/algo_bf.py | Ifkarsyah/College-IF2211-24-game-solver | 3028a582d35f0b133d4016e59e6446e51789ad38 | [
"MIT"
] | null | null | null | testing/algo_bf.py | Ifkarsyah/College-IF2211-24-game-solver | 3028a582d35f0b133d4016e59e6446e51789ad38 | [
"MIT"
] | null | null | null | from itertools import combinations_with_replacement, permutations
from tools import bracketting, score
def solve_bforce(inp=[10, 11, 12, 13], goal=24):
"""
Give expression that give max possible score.
solve_bf([10,11,12,13]) ==> '10+12+13-11'
"""
max_expr = max(generate_all_expr(inp), key... | 27.520833 | 75 | 0.573808 | from itertools import combinations_with_replacement, permutations
from tools import bracketting, score
def solve_bforce(inp=[10, 11, 12, 13], goal=24):
max_expr = max(generate_all_expr(inp), key=score)
return max_expr
def generate_all_expr(inp=[10, 11, 12, 13]):
op = "+-*/"
all_op = list(combination... | true | true |
08fdd233035258662837ef5fc348f3ef9cea56e6 | 386 | py | Python | profiles_api/api/permissions.py | swcho9919/profiles-rest-api | 24620e82cf464c4ab258241ee4a4ea1de9da3e5e | [
"MIT"
] | null | null | null | profiles_api/api/permissions.py | swcho9919/profiles-rest-api | 24620e82cf464c4ab258241ee4a4ea1de9da3e5e | [
"MIT"
] | 7 | 2019-12-04T23:34:51.000Z | 2022-02-10T09:03:53.000Z | profiles_api/api/permissions.py | swcho9919/profiles-rest-api | 24620e82cf464c4ab258241ee4a4ea1de9da3e5e | [
"MIT"
] | null | null | null | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
"""Allow user to edit their own product"""
def has_object_permission(self, request, view, obj):
"""Check user is trying to edit their own profile"""
if request.method in permissions.SAFE_METHODS:
... | 35.090909 | 60 | 0.686528 | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
if request.method in permissions.SAFE_METHODS:
return True
return obj.id == request.user.id | true | true |
08fdd3961b3c56b14a129fbf8b26765dfb3a19ab | 694 | py | Python | www/chapter_09/trends/forms.py | PacktPublishing/-Learn-MongoDB-4.0 | 011f14fc66c42498dcbf07e64e760b5e9f420243 | [
"MIT"
] | 13 | 2020-08-06T17:05:50.000Z | 2021-11-08T13:12:11.000Z | www/chapter_09/trends/forms.py | PacktPublishing/-Learn-MongoDB-4.0 | 011f14fc66c42498dcbf07e64e760b5e9f420243 | [
"MIT"
] | 4 | 2020-09-20T05:30:39.000Z | 2021-04-01T08:35:40.000Z | www/chapter_09/trends/forms.py | PacktPublishing/-Learn-MongoDB-4.0 | 011f14fc66c42498dcbf07e64e760b5e9f420243 | [
"MIT"
] | 12 | 2020-08-07T06:45:43.000Z | 2021-12-08T06:58:23.000Z | from django import forms
from django.core import validators
from django.core.validators import RegexValidator
"""
Request user input on key fields representing property location
"""
class TrendForm(forms.Form) :
# define fields
trend_city = forms.CharField(label='City',required=False)
trend_region =... | 43.375 | 127 | 0.752161 | from django import forms
from django.core import validators
from django.core.validators import RegexValidator
class TrendForm(forms.Form) :
trend_city = forms.CharField(label='City',required=False)
trend_region = forms.CharField(label='Region',required=False)
trend_locality = forms.CharField(lab... | true | true |
08fdd3dbb56e8f0873881fdc3d4cbe06250a8aed | 1,900 | py | Python | bindings/pydairlib/dircon_trajectory_plotter.py | DavidDePauw1/dairlib | 3c75c8f587927b12a58f2e88dda61cc0e7dc82a3 | [
"BSD-3-Clause"
] | null | null | null | bindings/pydairlib/dircon_trajectory_plotter.py | DavidDePauw1/dairlib | 3c75c8f587927b12a58f2e88dda61cc0e7dc82a3 | [
"BSD-3-Clause"
] | 2 | 2021-01-25T20:54:53.000Z | 2021-02-02T04:00:54.000Z | bindings/pydairlib/dircon_trajectory_plotter.py | DavidDePauw1/dairlib | 3c75c8f587927b12a58f2e88dda61cc0e7dc82a3 | [
"BSD-3-Clause"
] | null | null | null | import sys
import matplotlib.pyplot as plt
import pydairlib.lcm_trajectory
from pydairlib.common import FindResourceOrThrow
from pydrake.trajectories import PiecewisePolynomial
import numpy as np
def main():
# Default filename for the example
filename = FindResourceOrThrow("examples/Cassie/saved_trajectories/jump... | 34.545455 | 111 | 0.769474 | import sys
import matplotlib.pyplot as plt
import pydairlib.lcm_trajectory
from pydairlib.common import FindResourceOrThrow
from pydrake.trajectories import PiecewisePolynomial
import numpy as np
def main():
filename = FindResourceOrThrow("examples/Cassie/saved_trajectories/jumping_0.2h_0.25d")
if len(sys.argv)... | true | true |
08fdd43e295da226b54bac0d0327b3ad671cc532 | 1,497 | py | Python | iex_api/model/stocks.py | volpyx/iex-api | 8abd90bd2e5c037ed9e8962778d5675d5575d04c | [
"MIT"
] | 1 | 2020-12-21T09:06:56.000Z | 2020-12-21T09:06:56.000Z | iex_api/model/stocks.py | volpyx/iex-api | 8abd90bd2e5c037ed9e8962778d5675d5575d04c | [
"MIT"
] | 7 | 2020-12-17T18:38:47.000Z | 2020-12-20T11:29:42.000Z | iex_api/model/stocks.py | volpyx/iex-api | 8abd90bd2e5c037ed9e8962778d5675d5575d04c | [
"MIT"
] | null | null | null | import datetime
from dataclasses import dataclass
from typing import Optional
from dataclasses_json import LetterCase, dataclass_json
from iex_api.api.model.model import IEXRange
from iex_api.model.common import IEXTimeSeriesObject, SymbolMixin
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(frozen=True)
c... | 25.810345 | 66 | 0.732799 | import datetime
from dataclasses import dataclass
from typing import Optional
from dataclasses_json import LetterCase, dataclass_json
from iex_api.api.model.model import IEXRange
from iex_api.model.common import IEXTimeSeriesObject, SymbolMixin
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(frozen=True)
c... | true | true |
08fdd477c07f5ca4ae531474ae919aeb97e0ded8 | 6,545 | py | Python | src/fhir_types/FHIR_ObservationDefinition.py | anthem-ai/fhir-types | 42348655fb3a9b3f131b911d6bc0782da8c14ce4 | [
"Apache-2.0"
] | 2 | 2022-02-03T00:51:30.000Z | 2022-02-03T18:42:43.000Z | src/fhir_types/FHIR_ObservationDefinition.py | anthem-ai/fhir-types | 42348655fb3a9b3f131b911d6bc0782da8c14ce4 | [
"Apache-2.0"
] | null | null | null | src/fhir_types/FHIR_ObservationDefinition.py | anthem-ai/fhir-types | 42348655fb3a9b3f131b911d6bc0782da8c14ce4 | [
"Apache-2.0"
] | null | null | null | from typing import Any, List, Literal, TypedDict
from .FHIR_boolean import FHIR_boolean
from .FHIR_code import FHIR_code
from .FHIR_CodeableConcept import FHIR_CodeableConcept
from .FHIR_Element import FHIR_Element
from .FHIR_id import FHIR_id
from .FHIR_Identifier import FHIR_Identifier
from .FHIR_Meta import FHIR_Me... | 68.177083 | 839 | 0.739343 | from typing import Any, List, Literal, TypedDict
from .FHIR_boolean import FHIR_boolean
from .FHIR_code import FHIR_code
from .FHIR_CodeableConcept import FHIR_CodeableConcept
from .FHIR_Element import FHIR_Element
from .FHIR_id import FHIR_id
from .FHIR_Identifier import FHIR_Identifier
from .FHIR_Meta import FHIR_Me... | true | true |
08fdd4a90cec44b902ac9aae21d2a344ea14c406 | 523 | py | Python | trackdat-master/python/trackdat/__init__.py | keatonkraiger/pysot-mot | b1447dc9569339592a09b25b097b363cff9f6de4 | [
"Apache-2.0"
] | 1 | 2022-03-14T12:46:38.000Z | 2022-03-14T12:46:38.000Z | renderer/trackdat/python/trackdat/__init__.py | 12564985/DeFMO | 8ed9c2963678e2c59c7431ec8786302eea841572 | [
"MIT"
] | null | null | null | renderer/trackdat/python/trackdat/__init__.py | 12564985/DeFMO | 8ed9c2963678e2c59c7431ec8786302eea841572 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import dataset
from .dataset import Dataset
from .otb import load_otb
from .otb import load_tlp
from .otb import load_dtb70
from .vot import load_vot
from .nuspro import load_nuspro
from .nfs import lo... | 24.904762 | 41 | 0.837476 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import dataset
from .dataset import Dataset
from .otb import load_otb
from .otb import load_tlp
from .otb import load_dtb70
from .vot import load_vot
from .nuspro import load_nuspro
from .nfs import lo... | true | true |
08fdd53067d5e6ac5f95bcccf518e66ccc3d12bf | 235 | py | Python | tests/conftest.py | kingking888/skyscraper | d710202f9581c3791d2cf7ee3ae33e950e46c0b7 | [
"MIT"
] | 1 | 2021-03-21T07:25:43.000Z | 2021-03-21T07:25:43.000Z | tests/conftest.py | kingking888/skyscraper | d710202f9581c3791d2cf7ee3ae33e950e46c0b7 | [
"MIT"
] | null | null | null | tests/conftest.py | kingking888/skyscraper | d710202f9581c3791d2cf7ee3ae33e950e46c0b7 | [
"MIT"
] | 1 | 2021-04-24T11:38:18.000Z | 2021-04-24T11:38:18.000Z | import os
def pytest_configure(config):
# TODO: make the path flexible if possible, currently this forces us
# to run the tests from the root folder always
path = 'tests'
os.environ['currpath'] = path
return path
| 23.5 | 72 | 0.693617 | import os
def pytest_configure(config):
path = 'tests'
os.environ['currpath'] = path
return path
| true | true |
08fdd58bbd81d5d12e5d99edf73408c362f3aa33 | 118 | py | Python | 01_execute_python/myanswer_ex01.py | immortaltoken/python_exercises | baf1a19d21443fd38c16ae77812c73c6e91e17d2 | [
"MIT"
] | null | null | null | 01_execute_python/myanswer_ex01.py | immortaltoken/python_exercises | baf1a19d21443fd38c16ae77812c73c6e91e17d2 | [
"MIT"
] | null | null | null | 01_execute_python/myanswer_ex01.py | immortaltoken/python_exercises | baf1a19d21443fd38c16ae77812c73c6e91e17d2 | [
"MIT"
] | null | null | null | def main():
x=2
y=6
print(plus(x,y))
def plus(x,y):
return x+y
if __name__ == "__main__":
main() | 11.8 | 26 | 0.516949 | def main():
x=2
y=6
print(plus(x,y))
def plus(x,y):
return x+y
if __name__ == "__main__":
main() | true | true |
08fdd5d36e4d7f79649e15eeab0a14098171f994 | 1,228 | py | Python | quoter.py | jonathanmishler/cltools-backend | 1e2e0ac285acee3b66e5bd502a48cb301290506a | [
"MIT"
] | null | null | null | quoter.py | jonathanmishler/cltools-backend | 1e2e0ac285acee3b66e5bd502a48cb301290506a | [
"MIT"
] | null | null | null | quoter.py | jonathanmishler/cltools-backend | 1e2e0ac285acee3b66e5bd502a48cb301290506a | [
"MIT"
] | null | null | null | import asyncio
from requests_html import HTMLSession
import atparts
from redis import Redis
from rq import Queue
from rq.job import Job
# Setup RQ with REdis
redis_conn = Redis('localhost', 6379)
quoter_queue = Queue('quoter', connection=redis_conn)
class Quoter:
def __init__(self):
self.start_session(... | 25.583333 | 92 | 0.583062 | import asyncio
from requests_html import HTMLSession
import atparts
from redis import Redis
from rq import Queue
from rq.job import Job
redis_conn = Redis('localhost', 6379)
quoter_queue = Queue('quoter', connection=redis_conn)
class Quoter:
def __init__(self):
self.start_session()
self.loggedi... | true | true |
08fdd5dc481b8e2678e3f3278472430972151ea1 | 1,108 | py | Python | tkinter/listbox/listbox-scrollbar/main-2.py | furas/python-code | 223d8245c6a2a058031f302feaffd9a4f900110e | [
"MIT"
] | 2 | 2015-12-12T20:14:12.000Z | 2016-08-13T00:42:10.000Z | tkinter/listbox/listbox-scrollbar/main-2.py | furas/python-code | 223d8245c6a2a058031f302feaffd9a4f900110e | [
"MIT"
] | null | null | null | tkinter/listbox/listbox-scrollbar/main-2.py | furas/python-code | 223d8245c6a2a058031f302feaffd9a4f900110e | [
"MIT"
] | null | null | null | # author: Bartlomiej "furas" Burek (https://blog.furas.pl)
# date: 2022.03.11
import tkinter as tk
class ScrolledListbox(tk.Frame):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.listbox = tk.Listbox(self)
self.listbox.pack(side='left', fill='both', e... | 24.086957 | 90 | 0.648917 |
import tkinter as tk
class ScrolledListbox(tk.Frame):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.listbox = tk.Listbox(self)
self.listbox.pack(side='left', fill='both', expand=True)
self.scrollbar = tk.Scrollbar(self, orient='vertical', co... | true | true |
08fdd619f8598499202c299984740060f30c6769 | 59,936 | py | Python | pypy/rlib/rbigint.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/rlib/rbigint.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/rlib/rbigint.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | from pypy.rlib.rarithmetic import LONG_BIT, intmask, r_uint, r_ulonglong
from pypy.rlib.rarithmetic import ovfcheck, r_longlong, widen, is_valid_int
from pypy.rlib.rarithmetic import most_neg_value_of_same_type
from pypy.rlib.rfloat import isfinite
from pypy.rlib.debug import make_sure_not_resized, check_regular_int
fr... | 31.216667 | 80 | 0.551088 | from pypy.rlib.rarithmetic import LONG_BIT, intmask, r_uint, r_ulonglong
from pypy.rlib.rarithmetic import ovfcheck, r_longlong, widen, is_valid_int
from pypy.rlib.rarithmetic import most_neg_value_of_same_type
from pypy.rlib.rfloat import isfinite
from pypy.rlib.debug import make_sure_not_resized, check_regular_int
fr... | false | true |
08fdd708b7ddeb4c3d12a3c176cba416a80d4f81 | 3,519 | py | Python | generate_tfrecord.py | jason-sunjiankang/tensorflow_object_detection | dd53b458cb8809b9ec804f31aabdf04c76893977 | [
"MIT"
] | 1 | 2019-04-02T13:02:43.000Z | 2019-04-02T13:02:43.000Z | generate_tfrecord.py | jason-sunjiankang/tensorflow_object_detection | dd53b458cb8809b9ec804f31aabdf04c76893977 | [
"MIT"
] | null | null | null | generate_tfrecord.py | jason-sunjiankang/tensorflow_object_detection | dd53b458cb8809b9ec804f31aabdf04c76893977 | [
"MIT"
] | null | null | null | """
Usage:
# From tensorflow/models/
# Create train data:
python generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=train.record
# Create test data:
python generate_tfrecord.py --csv_input=data/test_labels.csv --output_path=test.record
"""
from __future__ import division
from __future__ i... | 32.88785 | 96 | 0.692526 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import io
import pandas as pd
import tensorflow as tf
from PIL import Image
from object_detection.utils import dataset_util
from collections import namedtuple, OrderedDict
def class_text_to_int(ro... | true | true |
08fdd72307a1afbb6897a9b51eda26099bd8db59 | 1,804 | py | Python | src/cogent3/parse/gcg.py | GavinHuttley/c3test | c5bf7f8252b4f7b75a851e28275536a8c378897a | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/parse/gcg.py | GavinHuttley/c3test | c5bf7f8252b4f7b75a851e28275536a8c378897a | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/parse/gcg.py | GavinHuttley/c3test | c5bf7f8252b4f7b75a851e28275536a8c378897a | [
"BSD-3-Clause"
] | 1 | 2020-05-04T02:44:00.000Z | 2020-05-04T02:44:00.000Z | #!/usr/bin/env python
__author__ = "Matthew Wakefield"
__copyright__ = "Copyright 2007-2020, The Cogent Project"
__credits__ = ["Matthew Wakefield", "Peter Maxwell", "Gavin Huttley"]
__license__ = "BSD-3"
__version__ = "2020.2.7a"
__maintainer__ = "Matthew Wakefield"
__email__ = "wakefield@wehi.edu.au"
__status__ = "P... | 30.576271 | 81 | 0.574834 |
__author__ = "Matthew Wakefield"
__copyright__ = "Copyright 2007-2020, The Cogent Project"
__credits__ = ["Matthew Wakefield", "Peter Maxwell", "Gavin Huttley"]
__license__ = "BSD-3"
__version__ = "2020.2.7a"
__maintainer__ = "Matthew Wakefield"
__email__ = "wakefield@wehi.edu.au"
__status__ = "Production"
import war... | true | true |
08fdd7550027045cd6f06c4591c87ffbd76e2941 | 2,418 | py | Python | model.py | HashGehlot03/HeartDiseasePrediction | 22a24b113d26e2fd776d28fc3c038474fb93741f | [
"MIT"
] | null | null | null | model.py | HashGehlot03/HeartDiseasePrediction | 22a24b113d26e2fd776d28fc3c038474fb93741f | [
"MIT"
] | null | null | null | model.py | HashGehlot03/HeartDiseasePrediction | 22a24b113d26e2fd776d28fc3c038474fb93741f | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier, GradientBoostingClassifier
from sklear... | 45.622642 | 270 | 0.750207 | import pandas as pd
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier, GradientBoostingClassifier
from sklear... | true | true |
08fdd7c6b7ceaa30997a499ed7f5aef460b8a279 | 232 | py | Python | word.py | Rakshithadevi/Word-count | cf903b24acb4545931326b8ec3bd2bf1ac660b86 | [
"BSD-3-Clause"
] | null | null | null | word.py | Rakshithadevi/Word-count | cf903b24acb4545931326b8ec3bd2bf1ac660b86 | [
"BSD-3-Clause"
] | null | null | null | word.py | Rakshithadevi/Word-count | cf903b24acb4545931326b8ec3bd2bf1ac660b86 | [
"BSD-3-Clause"
] | null | null | null | '''Reference no : 21005572
Developed by : Rakshitha devi.j'''
num_words =0
with open('text.txt','r') as file1:
for i in file1:
word =i.split()
num_words += len(word)
print("Number of words={0}".format(num_words)) | 29 | 46 | 0.637931 | num_words =0
with open('text.txt','r') as file1:
for i in file1:
word =i.split()
num_words += len(word)
print("Number of words={0}".format(num_words)) | true | true |
08fdd80894bc089cc70312b316ad33f411cef295 | 1,020 | py | Python | tests/Python/OWASP_a4/cwe_22/unsafe/cwe_22__I_readline__F_no_filtering__S_file_exists__1-7.3_File1.py | usnistgov/VTSG | f4477a78ec19f7e9757da0321cb5a69428e358cf | [
"MIT"
] | null | null | null | tests/Python/OWASP_a4/cwe_22/unsafe/cwe_22__I_readline__F_no_filtering__S_file_exists__1-7.3_File1.py | usnistgov/VTSG | f4477a78ec19f7e9757da0321cb5a69428e358cf | [
"MIT"
] | 1 | 2022-01-31T22:22:55.000Z | 2022-01-31T22:22:55.000Z | tests/Python/OWASP_a4/cwe_22/unsafe/cwe_22__I_readline__F_no_filtering__S_file_exists__1-7.3_File1.py | usnistgov/VTSG | f4477a78ec19f7e9757da0321cb5a69428e358cf | [
"MIT"
] | null | null | null |
'''
input: direct user input in string
no filtering
sink: check if a file exists
'''
'''
Created by Paul E. Black and William Mentzer 2020
This software was developed at the National Institute of Standards and Technology
by employees of the Federal Government in the course of their official duties.
Pursuant to title ... | 21.25 | 81 | 0.65 |
'''
input: direct user input in string
no filtering
sink: check if a file exists
'''
'''
Created by Paul E. Black and William Mentzer 2020
This software was developed at the National Institute of Standards and Technology
by employees of the Federal Government in the course of their official duties.
Pursuant to title ... | false | true |
08fdd8706eb41c9516a681efb07eebdf00b164a5 | 1,953 | py | Python | app/api/endpoints/places.py | CristianCrespo/fastapi-crud | 8424b0cd1e491210562c11563c5afea435fbf373 | [
"Apache-2.0"
] | null | null | null | app/api/endpoints/places.py | CristianCrespo/fastapi-crud | 8424b0cd1e491210562c11563c5afea435fbf373 | [
"Apache-2.0"
] | null | null | null | app/api/endpoints/places.py | CristianCrespo/fastapi-crud | 8424b0cd1e491210562c11563c5afea435fbf373 | [
"Apache-2.0"
] | null | null | null | from typing import Any, List
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from app.schemas import place
from app.crud import crud_place
from app.api import deps
from app.models.user import User
router = APIRouter()
@router.get("/places/",response_model=List[place.Place])
d... | 42.456522 | 151 | 0.742448 | from typing import Any, List
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from app.schemas import place
from app.crud import crud_place
from app.api import deps
from app.models.user import User
router = APIRouter()
@router.get("/places/",response_model=List[place.Place])
d... | true | true |
08fdd8f2a1761cc5f13a33fa46fe78eaba720f33 | 1,863 | py | Python | mTasks/task.py | theodox/mTasks | bae253e3713094ce47906dbd4bee130a4bde4cb4 | [
"MIT"
] | 29 | 2017-05-07T11:34:24.000Z | 2021-08-28T08:36:31.000Z | mTasks/task.py | techartorg/mTasks | bae253e3713094ce47906dbd4bee130a4bde4cb4 | [
"MIT"
] | 1 | 2017-06-28T07:48:51.000Z | 2017-07-03T06:42:12.000Z | mTasks/task.py | techartorg/mTasks | bae253e3713094ce47906dbd4bee130a4bde4cb4 | [
"MIT"
] | 3 | 2018-03-31T02:50:09.000Z | 2019-12-11T05:22:45.000Z | import inspect
__author__ = 'stevet'
import logging
task_logger = logging.getLogger('mTask')
class Task(object):
'''
Wraps a maya coroutine function.
Typically you won't construct these yourself, they are created by scheduler when calling 'spawn' or 'join'
'''
__slots__ = ('id', 'fn', 'state', '... | 27.397059 | 110 | 0.56307 | import inspect
__author__ = 'stevet'
import logging
task_logger = logging.getLogger('mTask')
class Task(object):
__slots__ = ('id', 'fn', 'state', 'callback')
_next_id = 0
def __init__(self, fn, callback=None):
assert inspect.isgeneratorfunction(fn) or hasattr(fn, "__call__")
... | true | true |
08fdd97e0a0a7c00572af815bed0195a833c2af1 | 5,224 | py | Python | python/onshape_client/oas/models/bt_list_response_bt_webhook_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 14 | 2019-06-23T08:47:41.000Z | 2021-11-29T16:28:45.000Z | python/onshape_client/oas/models/bt_list_response_bt_webhook_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 40 | 2019-05-22T14:39:46.000Z | 2022-03-10T10:36:17.000Z | python/onshape_client/oas/models/bt_list_response_bt_webhook_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 24 | 2019-06-02T01:03:41.000Z | 2022-03-29T13:25:36.000Z | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | 33.063291 | 100 | 0.598201 |
from __future__ import absolute_import
import re import sys
import six import nulltype
from onshape_client.oas.model_utils import ( ModelComposed,
ModelNormal,
ModelSimple,
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
from onsh... | true | true |
08fdd9c9de50b2387f12799342e3016551c66f17 | 607 | py | Python | experiments/migrations/0088_auto_20180626_1406.py | neuromat/portal | 78c1f8c9e20c46d283b693d54d009bd19bda90de | [
"CC-BY-4.0"
] | 3 | 2017-12-14T12:09:28.000Z | 2021-07-02T02:26:55.000Z | experiments/migrations/0088_auto_20180626_1406.py | neuromat/portal | 78c1f8c9e20c46d283b693d54d009bd19bda90de | [
"CC-BY-4.0"
] | null | null | null | experiments/migrations/0088_auto_20180626_1406.py | neuromat/portal | 78c1f8c9e20c46d283b693d54d009bd19bda90de | [
"CC-BY-4.0"
] | 1 | 2018-06-13T19:55:33.000Z | 2018-06-13T19:55:33.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-06-26 17:06
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('experiments', '0087_experimentresearcher_experiment'),
... | 27.590909 | 138 | 0.682043 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('experiments', '0087_experimentresearcher_experiment'),
]
operations = [
migrations.AlterField(
model_na... | true | true |
08fddb52b339d532616e5502ab7e8a544bac55d1 | 5,457 | py | Python | python/orca/src/bigdl/orca/data/tf/data.py | Forest216/BigDL | 840da9a2eaf395978dd83730b02aa5e5dfbd7989 | [
"Apache-2.0"
] | null | null | null | python/orca/src/bigdl/orca/data/tf/data.py | Forest216/BigDL | 840da9a2eaf395978dd83730b02aa5e5dfbd7989 | [
"Apache-2.0"
] | null | null | null | python/orca/src/bigdl/orca/data/tf/data.py | Forest216/BigDL | 840da9a2eaf395978dd83730b02aa5e5dfbd7989 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 36.139073 | 98 | 0.646876 | import tensorflow as tf
from bigdl.orca.tfpark.tf_dataset import TensorMeta
from bigdl.dllib.utils import nest
from bigdl.orca.data import SparkXShards
from bigdl.dllib.utils import log4Error
class Dataset(object):
def __init__(self, xshards, create_dataset_fn):
self.xshards = xshards
self.crea... | true | true |
08fddbfaed7c8d684e96b243f863cdf2d236b134 | 6,063 | py | Python | core/indexes.py | vsvarunsharma10/pqai | 3ef1351fbc39671916517917de9074a62b092eef | [
"MIT"
] | 17 | 2021-06-23T04:17:06.000Z | 2022-03-25T16:03:49.000Z | core/indexes.py | vsvarunsharma10/pqai | 3ef1351fbc39671916517917de9074a62b092eef | [
"MIT"
] | 15 | 2021-06-22T10:14:15.000Z | 2022-03-12T00:58:37.000Z | core/indexes.py | vsvarunsharma10/pqai | 3ef1351fbc39671916517917de9074a62b092eef | [
"MIT"
] | 3 | 2021-06-27T18:37:53.000Z | 2022-03-15T04:41:21.000Z | import numpy as np
import annoy
import json
import os
import faiss
from config.config import indexes_dir
from config import config
class Index():
def __init__(self):
self._search_fn = None
self._type = 'Index'
def search(self, query, n):
return self._search_fn(query, n)
@propert... | 29.009569 | 78 | 0.628072 | import numpy as np
import annoy
import json
import os
import faiss
from config.config import indexes_dir
from config import config
class Index():
def __init__(self):
self._search_fn = None
self._type = 'Index'
def search(self, query, n):
return self._search_fn(query, n)
@propert... | true | true |
08fddc330d99f6103875e26d3938ab254edd0758 | 1,483 | py | Python | src/jsonrpc/rpc.py | thomas-neuman/nkn-client-python | a64dd17fde55442c4904fe00a2448b9aeb734cf6 | [
"Apache-2.0"
] | null | null | null | src/jsonrpc/rpc.py | thomas-neuman/nkn-client-python | a64dd17fde55442c4904fe00a2448b9aeb734cf6 | [
"Apache-2.0"
] | null | null | null | src/jsonrpc/rpc.py | thomas-neuman/nkn-client-python | a64dd17fde55442c4904fe00a2448b9aeb734cf6 | [
"Apache-2.0"
] | null | null | null | import requests
import uuid
def _generate_id():
# Returns a randomly generated ID.
return str(uuid.uuid4())
def call_rpc(url, method, params=None, req_id=None):
"""
Call a JSON-RPC at the given URL.
Args:
method (str) : Name of the remote procedure to call.
params (iterable) : Parameters to pa... | 29.66 | 76 | 0.610924 | import requests
import uuid
def _generate_id():
return str(uuid.uuid4())
def call_rpc(url, method, params=None, req_id=None):
if req_id is None:
req_id = _generate_id()
payload = {
"jsonrpc": "2.0",
"method": method,
"id": (req_id if req_id is not None else _generate_id())
}
if params is ... | true | true |
08fddd08172c337bd1ed05240e41284dbc7085d6 | 283 | py | Python | rpa_logger/utils/__init__.py | kangasta/rpa_logger | 63fb9d2472cc8039b6d794c5a09f4fbb77f5ac23 | [
"MIT"
] | null | null | null | rpa_logger/utils/__init__.py | kangasta/rpa_logger | 63fb9d2472cc8039b6d794c5a09f4fbb77f5ac23 | [
"MIT"
] | null | null | null | rpa_logger/utils/__init__.py | kangasta/rpa_logger | 63fb9d2472cc8039b6d794c5a09f4fbb77f5ac23 | [
"MIT"
] | null | null | null | '''Utilities to make `rpa_logger` usage easier.
'''
from datetime import datetime
def timestamp():
'''Get UTC ISO-8601 timestamp for current time.
Returns:
String with UTC ISO-8601 timestamp for current time
'''
return f'{datetime.utcnow().isoformat()}Z'
| 20.214286 | 59 | 0.674912 |
from datetime import datetime
def timestamp():
return f'{datetime.utcnow().isoformat()}Z'
| true | true |
08fddd8d13efc50e559d07b81a975aac7c08f67d | 22,345 | py | Python | neutron_lbaas/services/loadbalancer/data_models.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | neutron_lbaas/services/loadbalancer/data_models.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | neutron_lbaas/services/loadbalancer/data_models.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 OpenStack Foundation.
# 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... | 38.327616 | 79 | 0.6452 |
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import servicetype_db
from sqlalchemy.ext import orderinglist
from sqlalchemy.orm import collections
from neutron_lbaas.db.loadbalancer import models
class BaseDataModel(object):
def to_dict(self, **kwargs):
ret = {}
... | true | true |
08fddde13117e489f5141be667b913634d5296f7 | 14,516 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/cr/crvserver_policymap_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/cr/crvserver_policymap_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/cr/crvserver_policymap_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.019851 | 328 | 0.744833 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro... | true | true |
08fdde987adadc0d73a9c9feaa4d1f229407d40b | 9,278 | py | Python | algos/train_expert_ppo_penalized.py | feloundou/safe-experts | 9592bd48ce7eed721a36cb688dd10dc7f527a13b | [
"Apache-2.0"
] | null | null | null | algos/train_expert_ppo_penalized.py | feloundou/safe-experts | 9592bd48ce7eed721a36cb688dd10dc7f527a13b | [
"Apache-2.0"
] | null | null | null | algos/train_expert_ppo_penalized.py | feloundou/safe-experts | 9592bd48ce7eed721a36cb688dd10dc7f527a13b | [
"Apache-2.0"
] | null | null | null | # Main entrance of GAIL
import numpy as np
import torch
import torch.nn.functional as F
from adabelief_pytorch import AdaBelief
import gym
import safety_gym
import time
from neural_nets import ActorCritic, count_vars
from utils import BufferActor
from utils import mpi_fork, proc_id, num_procs, EpochLogger,\
aver... | 34.110294 | 118 | 0.615865 | import numpy as np
import torch
import torch.nn.functional as F
from adabelief_pytorch import AdaBelief
import gym
import safety_gym
import time
from neural_nets import ActorCritic, count_vars
from utils import BufferActor
from utils import mpi_fork, proc_id, num_procs, EpochLogger,\
average_gradients, sync_all_... | true | true |
08fddf0d2b81ed807f4e36eb88c1fbcedb72aa23 | 1,963 | py | Python | physionet-django/project/migrations/0025_auto_20190710_1731.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 36 | 2019-02-14T18:10:39.000Z | 2022-01-21T12:48:52.000Z | physionet-django/project/migrations/0025_auto_20190710_1731.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 1,051 | 2019-01-31T18:03:14.000Z | 2022-03-31T20:53:04.000Z | physionet-django/project/migrations/0025_auto_20190710_1731.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 13 | 2019-03-26T11:02:32.000Z | 2022-03-17T11:39:49.000Z | # Generated by Django 2.1.7 on 2019-07-10 21:31
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
from django.core.management import call_command
from project.models import ProjectType
import os
def load_fixture(apps, schema_editor):
project_types_fixtures ... | 39.26 | 168 | 0.660214 |
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
from django.core.management import call_command
from project.models import ProjectType
import os
def load_fixture(apps, schema_editor):
project_types_fixtures = os.path.join(settings.BASE_DIR, 'project',
... | true | true |
08fddfdc67ab6d671505d3d6441b51b05b4f0471 | 2,212 | py | Python | src/gdb/gdb-8.3/gdb/testsuite/gdb.perf/lib/perftest/testresult.py | aps337/unum-sdk | 2de3ae625e474c5064f6a88b720ec2ffdcdefad9 | [
"Apache-2.0"
] | 31 | 2018-08-01T21:25:24.000Z | 2022-02-14T07:52:34.000Z | src/gdb/gdb-8.3/gdb/testsuite/gdb.perf/lib/perftest/testresult.py | aps337/unum-sdk | 2de3ae625e474c5064f6a88b720ec2ffdcdefad9 | [
"Apache-2.0"
] | 40 | 2018-12-03T19:48:52.000Z | 2021-03-10T06:34:26.000Z | src/gdb/gdb-8.3/gdb/testsuite/gdb.perf/lib/perftest/testresult.py | aps337/unum-sdk | 2de3ae625e474c5064f6a88b720ec2ffdcdefad9 | [
"Apache-2.0"
] | 20 | 2018-11-16T21:19:22.000Z | 2021-10-18T23:08:24.000Z | # Copyright (C) 2013-2019 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | 36.262295 | 71 | 0.702532 |
class TestResult(object):
def record(self, parameter, result):
raise NotImplementedError("Abstract Method:record.")
def report(self, reporter, name):
raise NotImplementedError("Abstract Method:report.")
class SingleStatisticTestResult(TestResult):
def __init__(self):
super (Sin... | true | true |
08fde13e7d8c1844983b8bbf01a088214f668eea | 3,097 | py | Python | project/utils/regex.py | ArnasSteponavicius00/graph_theory_project | fef3989370172efac834b953cdadb80a6aed3814 | [
"MIT"
] | null | null | null | project/utils/regex.py | ArnasSteponavicius00/graph_theory_project | fef3989370172efac834b953cdadb80a6aed3814 | [
"MIT"
] | null | null | null | project/utils/regex.py | ArnasSteponavicius00/graph_theory_project | fef3989370172efac834b953cdadb80a6aed3814 | [
"MIT"
] | 1 | 2021-11-20T07:12:38.000Z | 2021-11-20T07:12:38.000Z | #! usr/bin/env python3
#Arnas Steponavicius
#Adapted from Ian McLoughlin
from state import State
from fragment import Fragment
from shunting import shunt
def compile(infix):
"""Return NFA fragment of the infix expression
:param infix: regular expression
:type infix: string
:return: list
"""
#... | 29.778846 | 76 | 0.560865 |
from state import State
from fragment import Fragment
from shunting import shunt
def compile(infix):
postfix = shunt(infix)
postfix = list(postfix)[::-1]
nfa_stack = []
while postfix:
cChar = postfix.pop()
if cChar == '.':
frag1, frag... | true | true |
08fde195340aebc009608ca27b6ce92557888cd2 | 7,639 | py | Python | blobrepo/tests/test_repository.py | salotz/boar | c3022a65217e5befe37100a71632e6540e74992e | [
"Apache-2.0"
] | 2 | 2020-03-31T17:44:31.000Z | 2020-08-21T07:33:15.000Z | blobrepo/tests/test_repository.py | salotz/boar | c3022a65217e5befe37100a71632e6540e74992e | [
"Apache-2.0"
] | null | null | null | blobrepo/tests/test_repository.py | salotz/boar | c3022a65217e5befe37100a71632e6540e74992e | [
"Apache-2.0"
] | 1 | 2020-08-21T07:33:39.000Z | 2020-08-21T07:33:39.000Z | # -*- coding: utf-8 -*-
# Copyright 2010 Mats Ekberg
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 42.20442 | 111 | 0.677707 |
from builtins import range
import sys, os, unittest, tempfile, shutil
from copy import copy
DATA1 = b"tjosan"
DATA1_MD5 = "5558e0551622725a5fa380caffa94c5d"
DATA2 = b"tjosan hejsan"
DATA2_MD5 = "923574a1a36aebc7e1f586b7d363005e"
DATA3 = b"tjosan hejsan tjosan hejsan hejsan"
DATA3_MD5 = "cafa2ed1e085869b3bfe9e43b60e... | true | true |
08fde1fb4672892e75c217991154834d0681029e | 1,410 | py | Python | yWidgets/tests/conftest.py | trungleduc/ywidgets | 37139c94971104d389fbd5dfa00080357224cd2f | [
"BSD-3-Clause"
] | null | null | null | yWidgets/tests/conftest.py | trungleduc/ywidgets | 37139c94971104d389fbd5dfa00080357224cd2f | [
"BSD-3-Clause"
] | null | null | null | yWidgets/tests/conftest.py | trungleduc/ywidgets | 37139c94971104d389fbd5dfa00080357224cd2f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) Duc Trung Le.
# Distributed under the terms of the Modified BSD License.
import pytest
from ipykernel.comm import Comm
from ipywidgets import Widget
class MockComm(Comm):
"""A mock Comm object.
Can be used to inspect calls to Comm's open/send/close meth... | 25.636364 | 80 | 0.652482 |
import pytest
from ipykernel.comm import Comm
from ipywidgets import Widget
class MockComm(Comm):
comm_id = 'a-b-c-d'
kernel = 'Truthy'
def __init__(self, *args, **kwargs):
self.log_open = []
self.log_send = []
self.log_close = []
super(MockComm, self).__init__(*args, **... | true | true |
08fde2078caf52a0899c952c7da15a70138b92f7 | 13,083 | py | Python | theape/plugins/tests/subconfiguration_features/steps/subconfigurationfeature.py | rsnakamura/theape | c480fc197eef49c73fa25f3948e3cf45d79e4abe | [
"MIT"
] | null | null | null | theape/plugins/tests/subconfiguration_features/steps/subconfigurationfeature.py | rsnakamura/theape | c480fc197eef49c73fa25f3948e3cf45d79e4abe | [
"MIT"
] | null | null | null | theape/plugins/tests/subconfiguration_features/steps/subconfigurationfeature.py | rsnakamura/theape | c480fc197eef49c73fa25f3948e3cf45d79e4abe | [
"MIT"
] | null | null | null |
# third party
from behave import given, when, then
from hamcrest import assert_that, calling, raises, is_, instance_of
from hamcrest import has_entries, equal_to
from configobj import ConfigObj
from validate import Validator
from mock import MagicMock
# this package
from theape.plugins.base_plugin import SubConfigura... | 31.832117 | 128 | 0.644271 |
from behave import given, when, then
from hamcrest import assert_that, calling, raises, is_, instance_of
from hamcrest import has_entries, equal_to
from configobj import ConfigObj
from validate import Validator
from mock import MagicMock
from theape.plugins.base_plugin import SubConfiguration, SubConfigurationConstan... | true | true |
08fde32e53053863980fcccc49003c24e5b3cacb | 3,143 | py | Python | meta/hooks/post-commit.py | RichysHub/Squimoji | 73e231b147aebd4fbd63604ba212b87e726b54e8 | [
"CC-BY-4.0",
"MIT"
] | 3 | 2019-02-02T17:53:04.000Z | 2020-05-02T15:06:53.000Z | meta/hooks/post-commit.py | RichysHub/Squimoji | 73e231b147aebd4fbd63604ba212b87e726b54e8 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | meta/hooks/post-commit.py | RichysHub/Squimoji | 73e231b147aebd4fbd63604ba212b87e726b54e8 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | import os
import subprocess
import sys
"""
A very basic attempt to keep the 72x72/ directory up to date, without just rebuilding it all the time.
Not intended to be bulletproof, should just cover day-to-day building
"""
try:
with open(".commit", 'r') as commit_changes:
file_list = [line.rstrip() for line ... | 35.314607 | 102 | 0.646198 | import os
import subprocess
import sys
try:
with open(".commit", 'r') as commit_changes:
file_list = [line.rstrip() for line in commit_changes]
except FileNotFoundError:
sys.exit(0)
inkscape_executable = "C:/Program Files/Inkscape/inkscape.exe"
def to_character(filename):
return os.... | true | true |
08fde4855b865ebad300f1968b7e88b8354e98e5 | 236 | py | Python | DATETIME/DATETIME3.py | MakarFadeev/PythonTasks | 2ae18c3c6a50808f985966d3304a6af6824ce686 | [
"Apache-2.0"
] | 2 | 2020-11-13T05:59:45.000Z | 2020-11-29T09:26:20.000Z | DATETIME/DATETIME3.py | MakarFadeev/PythonTasks | 2ae18c3c6a50808f985966d3304a6af6824ce686 | [
"Apache-2.0"
] | 1 | 2020-10-29T18:14:10.000Z | 2020-10-29T18:14:10.000Z | DATETIME/DATETIME3.py | MakarFadeev/PythonTasks | 2ae18c3c6a50808f985966d3304a6af6824ce686 | [
"Apache-2.0"
] | null | null | null | import datetime
whatyear = int(input('Введите год: '))
month = 1
for month in range(1, 13):
whatyear0 = datetime.date(whatyear, month, 13)
if (whatyear0.weekday() == 4):
print('НАЙДЕНА ПЯТНИЦА 13!!! ДАТА: ', whatyear0)
| 26.222222 | 56 | 0.648305 | import datetime
whatyear = int(input('Введите год: '))
month = 1
for month in range(1, 13):
whatyear0 = datetime.date(whatyear, month, 13)
if (whatyear0.weekday() == 4):
print('НАЙДЕНА ПЯТНИЦА 13!!! ДАТА: ', whatyear0)
| true | true |
08fde4fdac2c469887a562427daa607fceed1507 | 443 | py | Python | blog/admin.py | Guo-xuejian/- | 100114eaba3fe4cc4f6ac7c67e2266b44d1a245b | [
"MulanPSL-1.0"
] | 1 | 2022-01-26T12:58:30.000Z | 2022-01-26T12:58:30.000Z | blog/admin.py | Guo-xuejian/bugua | 100114eaba3fe4cc4f6ac7c67e2266b44d1a245b | [
"MulanPSL-1.0"
] | null | null | null | blog/admin.py | Guo-xuejian/bugua | 100114eaba3fe4cc4f6ac7c67e2266b44d1a245b | [
"MulanPSL-1.0"
] | null | null | null | from django.contrib import admin
from blog import models
# 注册app,Django内置admin后台管理可见
admin.site.register(models.Log)
admin.site.register(models.Tag)
admin.site.register(models.Blog)
admin.site.register(models.Swiper)
admin.site.register(models.Article)
admin.site.register(models.Comment)
admin.site.register(models.Ca... | 27.6875 | 39 | 0.8307 | from django.contrib import admin
from blog import models
admin.site.register(models.Log)
admin.site.register(models.Tag)
admin.site.register(models.Blog)
admin.site.register(models.Swiper)
admin.site.register(models.Article)
admin.site.register(models.Comment)
admin.site.register(models.Category)
admin.site.register(... | true | true |
08fde53bacc34ece09f11d798cdbb9dde291f1d9 | 1,854 | py | Python | main/widget_forms/user_list.py | arturburiev/disconnect_schedule_client | 8af3940168e52f6b41107df7b103be639467cae7 | [
"Apache-2.0"
] | null | null | null | main/widget_forms/user_list.py | arturburiev/disconnect_schedule_client | 8af3940168e52f6b41107df7b103be639467cae7 | [
"Apache-2.0"
] | null | null | null | main/widget_forms/user_list.py | arturburiev/disconnect_schedule_client | 8af3940168e52f6b41107df7b103be639467cae7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qt_ui/user_list.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCo... | 42.136364 | 79 | 0.716289 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_UserListPage(object):
def setupUi(self, UserListPage):
UserListPage.setObjectName("UserListPage")
UserListPage.resize(400, 300)
self.gridLayout = QtWidgets.QGridLayout(UserListPage)
self.gridLayout.setObjectName("gridLayout")
... | true | true |
08fde6a15c72672a468e79435170d61cd323993e | 644 | py | Python | runners/wrapper.py | enizor/advent-of-code-2018 | 37cf61e447fd1bbf6ce9ce23f4b6432e7e81c792 | [
"MIT"
] | null | null | null | runners/wrapper.py | enizor/advent-of-code-2018 | 37cf61e447fd1bbf6ce9ce23f4b6432e7e81c792 | [
"MIT"
] | null | null | null | runners/wrapper.py | enizor/advent-of-code-2018 | 37cf61e447fd1bbf6ce9ce23f4b6432e7e81c792 | [
"MIT"
] | null | null | null | """
Wrapper class handling the communication between the main python process and
the funky language subprocesses.
"""
from .python import SubmissionPy
class SubmissionWrapper(SubmissionPy):
def __init__(self):
SubmissionPy.__init__(self)
# Method that every class implementing SubmssionWrapper shoul... | 23.851852 | 76 | 0.614907 |
from .python import SubmissionPy
class SubmissionWrapper(SubmissionPy):
def __init__(self):
SubmissionPy.__init__(self)
def exec(self, input):
pass
def run(self, input):
stdout = self.exec(input)
try:
lines = stdout.split('\n')[:-1]
if len(li... | true | true |
08fde7ebe5fb8eb40ac332e8b642333f8c42066d | 444 | py | Python | instaweight/dashboard/migrations/0004_auto_20191217_1500.py | ma02954AteebAhmed/InstaWeight | a1ef58d60cfecb867d78b87adc6df8929216dd10 | [
"Apache-2.0"
] | null | null | null | instaweight/dashboard/migrations/0004_auto_20191217_1500.py | ma02954AteebAhmed/InstaWeight | a1ef58d60cfecb867d78b87adc6df8929216dd10 | [
"Apache-2.0"
] | 14 | 2020-07-02T09:38:46.000Z | 2022-03-12T00:39:05.000Z | instaweight/dashboard/migrations/0004_auto_20191217_1500.py | ma02954AteebAhmed/InstaWeight | a1ef58d60cfecb867d78b87adc6df8929216dd10 | [
"Apache-2.0"
] | 1 | 2020-07-02T06:15:50.000Z | 2020-07-02T06:15:50.000Z | # Generated by Django 3.0 on 2019-12-17 10:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0003_auto_20191214_2008'),
]
operations = [
migrations.AlterField(
model_name='cattle',
name='image',
... | 23.368421 | 109 | 0.614865 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0003_auto_20191214_2008'),
]
operations = [
migrations.AlterField(
model_name='cattle',
name='image',
field=models.ImageField(default='http... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.