hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
441ba79bc36f9e4d678028c705cdcb40a02e9d38 | 13,360 | py | Python | code/python/FundsAPIforDigitalPortals/v2/fds/sdk/FundsAPIforDigitalPortals/model/fund_notation_screener_search_data_validation_prices.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/FundsAPIforDigitalPortals/v2/fds/sdk/FundsAPIforDigitalPortals/model/fund_notation_screener_search_data_validation_prices.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/FundsAPIforDigitalPortals/v2/fds/sdk/FundsAPIforDigitalPortals/model/fund_notation_screener_search_data_validation_prices.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Funds API For Digital Portals
Search for mutual funds and ETFs using one single consolidated API, including a criteria-based screener. The API provides also base data, key figures, and holdings. A separate endpoint returns the possible values and value range for the parameters that the endpoint /fund/nota... | 49.850746 | 1,125 | 0.617141 |
c3022c11b35f7d1a8e5a6a63f6fa5e42802f5d20 | 3,503 | py | Python | tests/movingGridMultiDisk/analytics.py | wangzhezhe/observerchain | faa8fb9d845a2720704538f01e1e7597083d4510 | [
"MIT"
] | null | null | null | tests/movingGridMultiDisk/analytics.py | wangzhezhe/observerchain | faa8fb9d845a2720704538f01e1e7597083d4510 | [
"MIT"
] | null | null | null | tests/movingGridMultiDisk/analytics.py | wangzhezhe/observerchain | faa8fb9d845a2720704538f01e1e7597083d4510 | [
"MIT"
] | null | null | null | from mpi4py import MPI
import numpy as np
import ctypes
import os
import time
import math
import timeit
import sys
import vtk
from vtk.util import numpy_support as VN
sys.path.append('../../src/publishclient/pythonclient')
import pubsub as pubsubclient
#comm = MPI.COMM_WORLD
#rank = comm.Get_rank()
# input the coo... | 23.198675 | 101 | 0.599201 |
74fc2028cea525b823b293ec9a4ca020c6d91655 | 4,465 | py | Python | src/model.py | HenrySilvaCS/esotericpainter | e510e8e4fadf83979eeb9f1d8e85ce20f0a0ddf8 | [
"Unlicense"
] | null | null | null | src/model.py | HenrySilvaCS/esotericpainter | e510e8e4fadf83979eeb9f1d8e85ce20f0a0ddf8 | [
"Unlicense"
] | null | null | null | src/model.py | HenrySilvaCS/esotericpainter | e510e8e4fadf83979eeb9f1d8e85ce20f0a0ddf8 | [
"Unlicense"
] | null | null | null | import torch
import torch.nn as nn
from torchvision.utils import make_grid
from torchvision.utils import save_image
from torchvision import transforms
import matplotlib.pyplot as plt
import os
from random_word import RandomWords
import random
BASEDIR = os.getcwd() + "/"
DATADIR = BASEDIR + "random_generated_images/"... | 34.882813 | 98 | 0.606271 |
2e7b5bc37e2df0ffe1b63c1db29d516ab0e0da50 | 1,352 | py | Python | tests/geometry/test_analytical.py | adacko/compas | 47c443ad3825897ec7ed932ec20734c2f08ef120 | [
"MIT"
] | null | null | null | tests/geometry/test_analytical.py | adacko/compas | 47c443ad3825897ec7ed932ec20734c2f08ef120 | [
"MIT"
] | null | null | null | tests/geometry/test_analytical.py | adacko/compas | 47c443ad3825897ec7ed932ec20734c2f08ef120 | [
"MIT"
] | 1 | 2022-01-16T02:32:43.000Z | 2022-01-16T02:32:43.000Z | import pytest
from compas.geometry import circle_evaluate
from compas.geometry import ellipse_evaluate
from compas.geometry import archimedean_spiral_evaluate
from compas.geometry import logarithmic_spiral_evaluate
from compas.geometry import helix_evaluate
from math import pi
def test_circle():
threshold = 1e-6
... | 36.540541 | 65 | 0.599112 |
de85033fcef6ad0866cc53a04cba0e502b3324fc | 6,414 | py | Python | picturebot/cli.py | Tomekske/picturebot-legacy | 5ca88b53d87bec769991f66ead60a30d6e5a006f | [
"MIT"
] | null | null | null | picturebot/cli.py | Tomekske/picturebot-legacy | 5ca88b53d87bec769991f66ead60a30d6e5a006f | [
"MIT"
] | 1 | 2021-11-15T17:49:06.000Z | 2021-11-15T17:49:06.000Z | picturebot/cli.py | Tomekske/picturebot-legacy | 5ca88b53d87bec769991f66ead60a30d6e5a006f | [
"MIT"
] | null | null | null | """Console script for picturebot."""
import sys
import os
import json
import shutil
import subprocess
import click
import picturebot as pb
from picturebot.helper import Helper as helper
import picturebot.poco as poco
import generalutils.guard as grd
import picturebot.workspace as ws
from picturebot.directory import Di... | 36.651429 | 230 | 0.663704 |
246e9679df4bf65cbf2a60b5539ee180b1865bd8 | 735 | py | Python | src/config/config.py | gregdurham/pyregistrator | d58172145d1c380cef1be85ee7eee30b6e93ccaa | [
"MIT"
] | null | null | null | src/config/config.py | gregdurham/pyregistrator | d58172145d1c380cef1be85ee7eee30b6e93ccaa | [
"MIT"
] | 1 | 2015-10-11T02:07:51.000Z | 2015-10-11T02:07:51.000Z | src/config/config.py | gregdurham/pyregistrator | d58172145d1c380cef1be85ee7eee30b6e93ccaa | [
"MIT"
] | null | null | null | from pykwalify.core import Core
from pykwalify.errors import SchemaError
from pkg_resources import resource_filename
import logging
logging.basicConfig()
logging.getLogger("pykwalify").setLevel(logging.CRITICAL)
class Config(object):
def __init__(self, config):
self.config = config
def validate(self)... | 29.4 | 115 | 0.703401 |
03d0ea64d979652bf759e06f5b8fd3b3a6d6cea7 | 12,020 | py | Python | PaperwithCode/1.Co-Interactive-Transformer/joint_model.py | techthiyanes/nlp-notebook | 0e5f4b75e635128d4056c89a6c65bea60c15e836 | [
"MIT"
] | 136 | 2021-04-18T12:03:55.000Z | 2022-03-31T14:58:46.000Z | PaperwithCode/1.Co-Interactive-Transformer/joint_model.py | techthiyanes/nlp-notebook | 0e5f4b75e635128d4056c89a6c65bea60c15e836 | [
"MIT"
] | 3 | 2021-08-08T08:38:06.000Z | 2022-03-26T17:17:40.000Z | PaperwithCode/1.Co-Interactive-Transformer/joint_model.py | techthiyanes/nlp-notebook | 0e5f4b75e635128d4056c89a6c65bea60c15e836 | [
"MIT"
] | 40 | 2021-05-18T06:55:37.000Z | 2022-03-30T00:47:12.000Z | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.functional as F
from crf import CRF
class Label_Attention(nn.Module):
def __init__(self, intent_emb, slot_emb):
# intent_emb:[n_class, hidden_dim]
# slot_emb:[n_tag, hidden_dim]
super(Label_Attention, self).__init__(... | 58.921569 | 162 | 0.675291 |
9863a92f017b8cb127004c21f35767ccbeae52b7 | 2,060 | py | Python | hs_access_control/tests/test_create_user.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_access_control/tests/test_create_user.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_access_control/tests/test_create_user.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | from django.test import TestCase
from django.contrib.auth.models import Group
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
from hs_access_control.tests.utilities import global_reset, \
assertUserResourceState, assertUserGroupState
class T01CreateUser(MockIRODSTestCaseMixin, ... | 32.1875 | 77 | 0.622816 |
5aca24ca63acf9673d2965b0d1d03078133f8c63 | 10,552 | py | Python | src/layers.py | zigonk/MST_inpainting | a06d8b433cda61f7f972abebcd0363b49943566d | [
"MIT"
] | 30 | 2021-03-29T06:14:07.000Z | 2022-01-24T03:38:34.000Z | src/layers.py | zigonk/MST_inpainting | a06d8b433cda61f7f972abebcd0363b49943566d | [
"MIT"
] | 1 | 2021-08-15T03:39:58.000Z | 2021-10-06T09:25:55.000Z | src/layers.py | zigonk/MST_inpainting | a06d8b433cda61f7f972abebcd0363b49943566d | [
"MIT"
] | 6 | 2021-11-10T03:49:47.000Z | 2022-03-18T03:38:18.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
class BaseNetwork(nn.Module):
def __init__(self):
super(BaseNetwork, self).__init__()
def init_weights(self, init_type='normal', gain=0.02):
'''
initialize network's weights
init_type: normal | xavier | kaiming... | 41.380392 | 132 | 0.563779 |
1c6904a0bb5b30c127a87e05ee16d085d6dad797 | 2,361 | py | Python | lib/taurus/qt/qtgui/dialog/taurusconfigurationdialog.py | MikeFalowski/taurus | ef041bf35dd847caf08a7efbe072f4020d35522e | [
"CC-BY-3.0"
] | 1 | 2016-10-19T13:54:08.000Z | 2016-10-19T13:54:08.000Z | lib/taurus/qt/qtgui/dialog/taurusconfigurationdialog.py | MikeFalowski/taurus | ef041bf35dd847caf08a7efbe072f4020d35522e | [
"CC-BY-3.0"
] | 27 | 2016-05-25T08:56:58.000Z | 2019-01-21T09:18:08.000Z | lib/taurus/qt/qtgui/dialog/taurusconfigurationdialog.py | MikeFalowski/taurus | ef041bf35dd847caf08a7efbe072f4020d35522e | [
"CC-BY-3.0"
] | 8 | 2015-07-24T09:16:50.000Z | 2018-06-12T12:33:59.000Z | # !/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under the terms of ... | 31.065789 | 83 | 0.659466 |
24ad80233e11f83a5b5a84e784395f5769767546 | 8,141 | py | Python | doc/source/conf.py | timClicks/pandas | 83b216c9efb439c1d19690feff1dcba58c6a2f88 | [
"BSD-3-Clause"
] | 1 | 2020-09-17T11:33:26.000Z | 2020-09-17T11:33:26.000Z | doc/source/conf.py | timClicks/pandas | 83b216c9efb439c1d19690feff1dcba58c6a2f88 | [
"BSD-3-Clause"
] | null | null | null | doc/source/conf.py | timClicks/pandas | 83b216c9efb439c1d19690feff1dcba58c6a2f88 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# pandas documentation build configuration file, created by
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that ... | 31.800781 | 80 | 0.691193 |
3e2bf6c70b06cce43a8fd0037fcb1899c5e1e6f2 | 1,205 | py | Python | products/models.py | ZendaInnocent/simple-online-book-store | 211e57fe32dc239ea01ce1160b621670cd4b3afa | [
"MIT"
] | 1 | 2020-04-13T20:26:24.000Z | 2020-04-13T20:26:24.000Z | products/models.py | ZendaInnocent/simple-online-book-store | 211e57fe32dc239ea01ce1160b621670cd4b3afa | [
"MIT"
] | null | null | null | products/models.py | ZendaInnocent/simple-online-book-store | 211e57fe32dc239ea01ce1160b621670cd4b3afa | [
"MIT"
] | null | null | null | from django.db import models
from django.urls import reverse
class ProductManager(models.Manager):
def active(self):
return self.filter(active=True)
class Product(models.Model):
name = models.CharField(max_length=50)
slug = models.SlugField()
description = models.TextField(blank=True)
pr... | 29.390244 | 77 | 0.727801 |
661c77b596aba446c3078ad7fea67435ab0572cc | 62,745 | py | Python | neutron/plugins/nuage/plugin.py | armando-migliaccio/neutron-1 | e31861c15bc73e65a7c22212df2a56f9e45aa0e4 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/nuage/plugin.py | armando-migliaccio/neutron-1 | e31861c15bc73e65a7c22212df2a56f9e45aa0e4 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/nuage/plugin.py | armando-migliaccio/neutron-1 | e31861c15bc73e65a7c22212df2a56f9e45aa0e4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Alcatel-Lucent USA 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 l... | 47.247741 | 79 | 0.544936 |
09fc70de33560091e2f3692054d80d2dddda1376 | 32,890 | py | Python | Ansible-AWS-Provisioning/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_nat_gateway.py | ginigangadharan/ansible-real-life | 897c2fc0d05babbb540768b336b6ad399dad5bfa | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Ansible-AWS-Provisioning/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_nat_gateway.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | null | null | null | Ansible-AWS-Provisioning/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_nat_gateway.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 32.087805 | 125 | 0.561204 |
ec06965a1e5120c2ae6bf614761527fb8942092d | 3,015 | py | Python | python/masa/lib/python3.4/site-packages/sdl2/test/sdl2ext_draw_test.py | tekktonic/programming | 139959ab9934912d4c531e5ee8b1f39094a6823c | [
"0BSD"
] | 3 | 2016-07-16T12:19:43.000Z | 2021-04-22T19:25:53.000Z | sdl2/test/sdl2ext_draw_test.py | GreatFruitOmsk/py-sdl2 | 8d1465b6238ab33c14ce0dc473529e7b38650062 | [
"DOC"
] | null | null | null | sdl2/test/sdl2ext_draw_test.py | GreatFruitOmsk/py-sdl2 | 8d1465b6238ab33c14ce0dc473529e7b38650062 | [
"DOC"
] | 3 | 2018-09-13T09:08:02.000Z | 2021-04-07T18:44:32.000Z | import sys
import unittest
from ..ext.color import Color, COLOR
from .. import ext as sdl2ext
class SDL2ExtDrawTest(unittest.TestCase):
__tags__ = ["sdl", "sdl2ext"]
def setUp(self):
sdl2ext.init()
def tearDown(self):
sdl2ext.quit()
@unittest.skipIf(hasattr(sys, "pypy_version_info")... | 35.892857 | 76 | 0.46534 |
56194e6f60448bed155e64eb651dc3dd3fcd5000 | 2,416 | py | Python | cart/models.py | lautarianoo/django_shop | 9bc575df8b7af5452bd15cc3cf4fb375be6384bd | [
"MIT"
] | null | null | null | cart/models.py | lautarianoo/django_shop | 9bc575df8b7af5452bd15cc3cf4fb375be6384bd | [
"MIT"
] | null | null | null | cart/models.py | lautarianoo/django_shop | 9bc575df8b7af5452bd15cc3cf4fb375be6384bd | [
"MIT"
] | null | null | null | from django.db import models
from product.models import Product
from django.core import checks
from customer.models import Customer
class CartItem(models.Model):
product = models.OneToOneField(
Product,
on_delete=models.CASCADE,
blank=True,
related_name='items',
)
quantity ... | 32.648649 | 88 | 0.622517 |
fd30fca01f409dfa24f44f7843e51312648c2b13 | 1,894 | py | Python | setup.py | psteinb/VoidSeg | 6e091656f6d777452b0e36644e9eb4a6818792d2 | [
"BSD-3-Clause"
] | null | null | null | setup.py | psteinb/VoidSeg | 6e091656f6d777452b0e36644e9eb4a6818792d2 | [
"BSD-3-Clause"
] | null | null | null | setup.py | psteinb/VoidSeg | 6e091656f6d777452b0e36644e9eb4a6818792d2 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from setuptools import setup, find_packages
from os import path
_dir = path.abspath(path.dirname(__file__))
with open(path.join(_dir,'voidseg','version.py')) as f:
exec(f.read())
with open(path.join(_dir,'README.md')) as f:
long_description = f.read()
setup(name='void... | 33.22807 | 123 | 0.609293 |
b980cb61d083ff368279a229451f13d55386f0b1 | 5,684 | py | Python | examples/pwr_run/checkpointing/jobs_max_par/job8.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/jobs_max_par/job8.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/jobs_max_par/job8.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 29.915789 | 118 | 0.703202 |
11e75c1655ee37ec4ce251e89bcb7784ac79cc0f | 4,046 | py | Python | sdk/python/pulumi_azure_native/streamanalytics/v20200301/_enums.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/streamanalytics/v20200301/_enums.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/streamanalytics/v20200301/_enums.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'AuthenticationMode',
'CompatibilityLevel',
'CompressionType',
'ContentStoragePolicy',
'Encoding... | 31.123077 | 449 | 0.702422 |
ec8018e8afa9e80685f0829b3c1bdb2e01a2511a | 36,990 | py | Python | tests/admin_changelist/tests.py | TomasM/django | 1fc28b7aef76115fcd6e3931f0c0dda175297d3f | [
"BSD-3-Clause"
] | null | null | null | tests/admin_changelist/tests.py | TomasM/django | 1fc28b7aef76115fcd6e3931f0c0dda175297d3f | [
"BSD-3-Clause"
] | null | null | null | tests/admin_changelist/tests.py | TomasM/django | 1fc28b7aef76115fcd6e3931f0c0dda175297d3f | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.tests import AdminS... | 45.8933 | 164 | 0.653339 |
59fc369152eefd23f8d84a524594bcea58fde0b2 | 1,427 | py | Python | examples/pumpkin-mcu-api-example/example_mcu_api.py | srjustice/kubos | ff33c17a7b5335d981cd0a49c65874f9f733338d | [
"Apache-2.0"
] | null | null | null | examples/pumpkin-mcu-api-example/example_mcu_api.py | srjustice/kubos | ff33c17a7b5335d981cd0a49c65874f9f733338d | [
"Apache-2.0"
] | null | null | null | examples/pumpkin-mcu-api-example/example_mcu_api.py | srjustice/kubos | ff33c17a7b5335d981cd0a49c65874f9f733338d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 Kubos Corporation
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
"""
Example usage of the mcu_api
"""
import mcu_api
import time
MODULES = {
"sim": {"address": 80},
"gpsrm": {"address": 81},
"pim": {"address": 83},
"rhm": {"... | 25.035088 | 71 | 0.670638 |
38f797ead2a7c58c381f6d36e539efcd6a2fc309 | 3,516 | py | Python | test/test_monitor.py | pwned-17/SecureTea-Project | f32fcd5054155567b4511ee69ae1617ed595655a | [
"MIT"
] | 257 | 2018-03-28T12:43:20.000Z | 2022-03-29T07:07:23.000Z | test/test_monitor.py | pwned-17/SecureTea-Project | f32fcd5054155567b4511ee69ae1617ed595655a | [
"MIT"
] | 155 | 2018-03-31T14:57:46.000Z | 2022-03-17T18:12:41.000Z | test/test_monitor.py | pwned-17/SecureTea-Project | f32fcd5054155567b4511ee69ae1617ed595655a | [
"MIT"
] | 132 | 2018-03-27T06:25:20.000Z | 2022-03-28T11:32:45.000Z | # -*- coding: utf-8 -*-
import unittest
from securetea.lib.web_deface.monitor import Monitor
from securetea.lib.web_deface.deface_logger import DefaceLogger
from securetea.lib.web_deface.gather_file import GatherFile
from securetea.lib.web_deface.hash_gen import Hash
from securetea.lib.web_deface.defacement_detec... | 39.066667 | 99 | 0.620592 |
48d2217fd30ee0981feb51463e6beaf06d1bac1c | 706 | py | Python | docs/components_page/components/layout/breakpoints.py | imrehg/dash-bootstrap-components | 7cf43168808bb88b243e414168dc3bf196fefd84 | [
"Apache-2.0"
] | 1 | 2021-05-08T08:21:41.000Z | 2021-05-08T08:21:41.000Z | docs/components_page/components/layout/breakpoints.py | imrehg/dash-bootstrap-components | 7cf43168808bb88b243e414168dc3bf196fefd84 | [
"Apache-2.0"
] | null | null | null | docs/components_page/components/layout/breakpoints.py | imrehg/dash-bootstrap-components | 7cf43168808bb88b243e414168dc3bf196fefd84 | [
"Apache-2.0"
] | null | null | null | import dash_bootstrap_components as dbc
import dash_html_components as html
row = html.Div(
[
dbc.Row(
[
dbc.Col(html.Div("One of three columns"), md=4),
dbc.Col(html.Div("One of three columns"), md=4),
dbc.Col(html.Div("One of three columns"), md... | 30.695652 | 72 | 0.483003 |
0b9fdcdbe7bca44a103fa9a2c3b6e7ec22a3f2cf | 2,083 | py | Python | tests/__init__.py | wesrog/simple-db-migrate | 5d5637cbb96424676571431bb688f8b977b0837d | [
"Apache-2.0"
] | 1 | 2017-12-14T22:20:30.000Z | 2017-12-14T22:20:30.000Z | tests/__init__.py | wesrog/simple-db-migrate | 5d5637cbb96424676571431bb688f8b977b0837d | [
"Apache-2.0"
] | null | null | null | tests/__init__.py | wesrog/simple-db-migrate | 5d5637cbb96424676571431bb688f8b977b0837d | [
"Apache-2.0"
] | null | null | null | import glob
import os
import unittest
import codecs
from simple_db_migrate.config import *
def create_file(file_name, content=None, encoding='utf-8'):
f = codecs.open(file_name, 'w', encoding)
if content:
f.write(content)
f.close()
return file_name
def create_migration_file(file_name, sql_up='... | 35.913793 | 162 | 0.679309 |
335142be0a429e0cfea3109578e96a6e6c744822 | 411 | py | Python | prog/tmux/theme/misc_segments/__init__.py | mohkale/.dotfiles | 273cbfba85edda8730954d9dcffb82b858bc9433 | [
"MIT"
] | null | null | null | prog/tmux/theme/misc_segments/__init__.py | mohkale/.dotfiles | 273cbfba85edda8730954d9dcffb82b858bc9433 | [
"MIT"
] | null | null | null | prog/tmux/theme/misc_segments/__init__.py | mohkale/.dotfiles | 273cbfba85edda8730954d9dcffb82b858bc9433 | [
"MIT"
] | null | null | null | """Miscellaneous segments for my tmux status-line."""
from .base import StatusMiscSegment
from .mpd import MPDSegment
from .github import GithubNotificationsSegment
from .nordvpn import NordVPNSegment
from .mullvad_vpn import MullvadVPNSegment
from .notmuch import NotMuchSegment
from .transm... | 34.25 | 57 | 0.800487 |
595cff82d3e8d43b15dc25f35e2ff0ece82a1f99 | 9,035 | py | Python | tools/python/google/webpagereplay_utils.py | robclark/chromium | f097b6ea775c27e5352c94ddddd264dd2af21479 | [
"BSD-3-Clause"
] | 1 | 2019-07-22T23:03:26.000Z | 2019-07-22T23:03:26.000Z | tools/python/google/webpagereplay_utils.py | robclark/chromium | f097b6ea775c27e5352c94ddddd264dd2af21479 | [
"BSD-3-Clause"
] | null | null | null | tools/python/google/webpagereplay_utils.py | robclark/chromium | f097b6ea775c27e5352c94ddddd264dd2af21479 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A class to help start/stop a Web Page Replay Server.
The page cycler tests use this module to run Web Page Replay
(see tools/bu... | 33.462963 | 80 | 0.672385 |
a1cbc0ab88172b8df0037e5e1d507404e620e551 | 178 | py | Python | 0x04-python-more_data_structures/3-common_elements.py | calypsobronte/holbertonschool-higher_level_programming | c39c060d8473976fa475d22fffba5cb4329c9965 | [
"MIT"
] | null | null | null | 0x04-python-more_data_structures/3-common_elements.py | calypsobronte/holbertonschool-higher_level_programming | c39c060d8473976fa475d22fffba5cb4329c9965 | [
"MIT"
] | null | null | null | 0x04-python-more_data_structures/3-common_elements.py | calypsobronte/holbertonschool-higher_level_programming | c39c060d8473976fa475d22fffba5cb4329c9965 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
def common_elements(set_1, set_2):
result = []
for element in set_1:
if element in set_2:
result.append(element)
return result
| 22.25 | 34 | 0.623596 |
d26e80d87b36f85e32156689eb46739d78d42199 | 7,339 | py | Python | websauna/tests/test_retry.py | maikroeder/websauna | fd266cf5e4761cd4c1f3e33be47ad8358b4c6afa | [
"CNRI-Python"
] | null | null | null | websauna/tests/test_retry.py | maikroeder/websauna | fd266cf5e4761cd4c1f3e33be47ad8358b4c6afa | [
"CNRI-Python"
] | null | null | null | websauna/tests/test_retry.py | maikroeder/websauna | fd266cf5e4761cd4c1f3e33be47ad8358b4c6afa | [
"CNRI-Python"
] | 1 | 2021-04-15T17:35:57.000Z | 2021-04-15T17:35:57.000Z | """Test SQL transaction conflict resolution."""
import threading
import time
import pytest
from sqlalchemy import Column
from sqlalchemy import Numeric
from sqlalchemy import Integer
import transaction
from websauna.system.model.meta import create_dbsession, Base
from websauna.system.model.retry import retryable, Ca... | 30.077869 | 239 | 0.682518 |
2373eb11c6668613c49c0919415f654f42a85861 | 1,807 | py | Python | website/handlers.py | megaraph/johnian-network | 1289323d17444d56efa3c92cbe49f9b2df010e9f | [
"MIT"
] | 1 | 2021-12-15T09:39:57.000Z | 2021-12-15T09:39:57.000Z | website/handlers.py | megaraph/johnian-network | 1289323d17444d56efa3c92cbe49f9b2df010e9f | [
"MIT"
] | null | null | null | website/handlers.py | megaraph/johnian-network | 1289323d17444d56efa3c92cbe49f9b2df010e9f | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template
errors = Blueprint('errors', __name__)
@errors.app_errorhandler(404)
def error_404(error):
error_popper = "Oh no!"
error_code = "404"
error_img = error_code
error_message = "Deadend! Comeback to the homepage and continue where you left off"
return rend... | 28.234375 | 106 | 0.68788 |
6a1f5c2d5983f7f1850f316333009599ea607db8 | 2,026 | py | Python | pages/base_page.py | veffhz/selenium_page_object | 237f8a31a118aaeeba8379bad219266d75edf635 | [
"MIT"
] | null | null | null | pages/base_page.py | veffhz/selenium_page_object | 237f8a31a118aaeeba8379bad219266d75edf635 | [
"MIT"
] | null | null | null | pages/base_page.py | veffhz/selenium_page_object | 237f8a31a118aaeeba8379bad219266d75edf635 | [
"MIT"
] | null | null | null | from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException, TimeoutException
from selenium.webdriver.support.wait import WebDriverWait
from .locators import BasePageLocators
class BasePage:
def __init__(self, browser, url, timeout=10):
se... | 32.677419 | 99 | 0.67769 |
aa3a991d02defe69c352599f893a22c0c4e7afc5 | 1,341 | py | Python | thumt/modules/embedding.py | Yuran-Zhao/THUMT | 10f0433c1f2fe3f992d26ccb6f4f8dec457ce695 | [
"BSD-3-Clause"
] | 422 | 2018-12-03T19:47:06.000Z | 2022-03-29T13:18:09.000Z | thumt/modules/embedding.py | Yuran-Zhao/THUMT | 10f0433c1f2fe3f992d26ccb6f4f8dec457ce695 | [
"BSD-3-Clause"
] | 60 | 2019-02-11T02:43:52.000Z | 2022-02-20T07:24:40.000Z | thumt/modules/embedding.py | Yuran-Zhao/THUMT | 10f0433c1f2fe3f992d26ccb6f4f8dec457ce695 | [
"BSD-3-Clause"
] | 121 | 2018-12-29T03:40:40.000Z | 2022-03-03T11:33:23.000Z | # coding=utf-8
# Copyright 2017-2020 The THUMT Authors
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import torch
class PositionalEmbedding(torch.nn.Module):
def __init__(self):
super(PositionalEmbedding, self).__init__()
d... | 31.186047 | 76 | 0.598807 |
cfb9bd2c8b4bb5c927f86f28d9d5a2588fb52139 | 92 | py | Python | cripts/core/user_migrate.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | 2 | 2017-04-06T12:26:11.000Z | 2018-11-05T19:17:15.000Z | cripts/core/user_migrate.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | 9 | 2016-09-28T10:19:10.000Z | 2017-02-24T17:58:43.000Z | cripts/core/user_migrate.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | null | null | null | def migrate_user(self):
"""
Migrate to latest schema version.
"""
return
| 10.222222 | 37 | 0.576087 |
6dd9254a4fa6c53a449d5ab827e96ed56bdaeda8 | 5,112 | py | Python | piecrust/processing/sass.py | ludovicchabant/PieCrust2 | 89b2bf268bfdaae24ff6cf6d8c29c0b1239be739 | [
"Apache-2.0"
] | 43 | 2015-04-24T05:30:04.000Z | 2022-02-03T17:47:35.000Z | piecrust/processing/sass.py | ludovicchabant/PieCrust2 | 89b2bf268bfdaae24ff6cf6d8c29c0b1239be739 | [
"Apache-2.0"
] | 54 | 2015-01-03T01:58:44.000Z | 2021-05-06T21:56:26.000Z | piecrust/processing/sass.py | ludovicchabant/PieCrust2 | 89b2bf268bfdaae24ff6cf6d8c29c0b1239be739 | [
"Apache-2.0"
] | 8 | 2015-05-10T01:50:46.000Z | 2016-12-26T20:53:15.000Z | import os
import os.path
import json
import hashlib
import logging
import platform
import subprocess
from piecrust.processing.base import SimpleFileProcessor, FORCE_BUILD
logger = logging.getLogger(__name__)
class SassProcessor(SimpleFileProcessor):
PROCESSOR_NAME = 'sass'
def __init__(self):
super... | 32.35443 | 77 | 0.57766 |
fe0e009199fba49fbbacf67cd7fa2d6503af0dfa | 3,461 | py | Python | Python/dhproc dev/p_cmd_in.py | theflorianmaas/dh | 5e774ff084590cde146fad4cc677b8af001c956f | [
"MIT"
] | null | null | null | Python/dhproc dev/p_cmd_in.py | theflorianmaas/dh | 5e774ff084590cde146fad4cc677b8af001c956f | [
"MIT"
] | null | null | null | Python/dhproc dev/p_cmd_in.py | theflorianmaas/dh | 5e774ff084590cde146fad4cc677b8af001c956f | [
"MIT"
] | 1 | 2018-12-02T19:44:14.000Z | 2018-12-02T19:44:14.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ver 18 - 15 November 2017 -
import time
import string
import sys
import mysql.connector
from mysql.connector import errorcode, pooling
from db import *
import datetime
#from threading import Thread
import multiprocessing as mp
from multiprocessing import Queue
from multipro... | 25.448529 | 90 | 0.619474 |
6a4c60767ce8a0f55eb115ac93df45d0238e8308 | 79 | py | Python | 0x00-python-hello_world/102-magic_calculation.py | darkares23/holbertonschool-higher_level_programming | 931b1b701d8a1d990b7cd931486496c0b5502e21 | [
"MIT"
] | null | null | null | 0x00-python-hello_world/102-magic_calculation.py | darkares23/holbertonschool-higher_level_programming | 931b1b701d8a1d990b7cd931486496c0b5502e21 | [
"MIT"
] | null | null | null | 0x00-python-hello_world/102-magic_calculation.py | darkares23/holbertonschool-higher_level_programming | 931b1b701d8a1d990b7cd931486496c0b5502e21 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
def magic_calculation(a, b):
return (98 + a ** b)
| 13.166667 | 28 | 0.56962 |
97bb9a66440da241618b67d89d2a9195af6ebf52 | 1,134 | py | Python | transformers/_old/xom-topics.py | winnieepm/aanalte | 6f1e8e34cf84b2176e4c1bce91668502f6c016e0 | [
"MIT"
] | null | null | null | transformers/_old/xom-topics.py | winnieepm/aanalte | 6f1e8e34cf84b2176e4c1bce91668502f6c016e0 | [
"MIT"
] | 7 | 2021-07-23T14:08:32.000Z | 2021-07-25T14:56:35.000Z | transformers/_old/xom-topics.py | winnieepm/aanalte | 6f1e8e34cf84b2176e4c1bce91668502f6c016e0 | [
"MIT"
] | 1 | 2022-02-04T21:36:34.000Z | 2022-02-04T21:36:34.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Extracts distinct referenced topics from text and returns a CSV.
"""
import re
import pandas as pd
# Create xom-topics.csv
cmd = "xsltproc xom-topics.xsl xom-all-flat-mod-pnums.xml > xom-topics.csv"
import os
os.system(cmd)
bigline = ''
with open('xom-topics.csv', ... | 29.842105 | 91 | 0.646384 |
3321520fd39d64663cd400cb5a8cbae3fc043a58 | 4,045 | py | Python | tests/test_linux_framebuffer_device.py | AlessioMorale/luma.core | 0b33e512a4ef8c7ae91ccd019bbe9fec0fbdcac6 | [
"MIT"
] | 114 | 2017-01-13T16:06:46.000Z | 2022-03-23T23:51:45.000Z | tests/test_linux_framebuffer_device.py | AlessioMorale/luma.core | 0b33e512a4ef8c7ae91ccd019bbe9fec0fbdcac6 | [
"MIT"
] | 192 | 2017-01-12T18:00:00.000Z | 2022-02-20T22:38:31.000Z | tests/test_linux_framebuffer_device.py | AlessioMorale/luma.core | 0b33e512a4ef8c7ae91ccd019bbe9fec0fbdcac6 | [
"MIT"
] | 58 | 2017-01-21T13:54:03.000Z | 2022-03-06T15:48:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Richard Hull and contributors
# See LICENSE.rst for details.
"""
Tests for the :py:class:`luma.core.device.framebuffer` class.
"""
import os
import pytest
from luma.core.render import canvas
from luma.core.framebuffer import full_frame
from luma.core.... | 32.886179 | 101 | 0.663535 |
fe936b3e6204308d29cdc786cee47c710713c3df | 10,969 | py | Python | synapse/storage/__init__.py | xsteadfastx/synapse | 9a8ae6f1bf833b58416fae1add1972ac3e9d2d59 | [
"Apache-2.0"
] | 1 | 2017-02-03T18:58:29.000Z | 2017-02-03T18:58:29.000Z | synapse/storage/__init__.py | xsteadfastx/synapse | 9a8ae6f1bf833b58416fae1add1972ac3e9d2d59 | [
"Apache-2.0"
] | null | null | null | synapse/storage/__init__.py | xsteadfastx/synapse | 9a8ae6f1bf833b58416fae1add1972ac3e9d2d59 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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 applicab... | 36.808725 | 88 | 0.661865 |
afb66732b50ea5ef937c0de962a4a54c0989865f | 334 | py | Python | noise/exceptions.py | jarret/noiseprotocol | e737e159b5c836ff03e4dc93ac386a4e7d610ec8 | [
"MIT"
] | 169 | 2017-09-12T20:43:39.000Z | 2022-03-20T15:23:31.000Z | noise/exceptions.py | jarret/noiseprotocol | e737e159b5c836ff03e4dc93ac386a4e7d610ec8 | [
"MIT"
] | 32 | 2017-09-13T11:03:12.000Z | 2021-06-23T15:25:40.000Z | noise/exceptions.py | jarret/noiseprotocol | e737e159b5c836ff03e4dc93ac386a4e7d610ec8 | [
"MIT"
] | 18 | 2018-03-15T19:28:51.000Z | 2021-11-01T18:59:20.000Z | class NoiseProtocolNameError(Exception):
pass
class NoisePSKError(Exception):
pass
class NoiseValueError(Exception):
pass
class NoiseHandshakeError(Exception):
pass
class NoiseInvalidMessage(Exception):
pass
class NoiseMaxNonceError(Exception):
pass
class NoiseValidationError(Excepti... | 12.37037 | 40 | 0.754491 |
5a1e13b6ea2d32000c0a57b166817c1250cc1df3 | 237 | py | Python | Advance_Python/Exception_Handling/Catching_Specific_Exception.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Exception_Handling/Catching_Specific_Exception.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Exception_Handling/Catching_Specific_Exception.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | # Catching Specific Exception
try:
a = int(input("Enter a : "))
b = int(input("Enter b : "))
c = a / b
print(c)
except ZeroDivisionError:
print("division by zero")
except NameError:
print("name is not defined") | 18.230769 | 32 | 0.611814 |
236f56ebee647da1e638c0c765b9af34368035f1 | 6,025 | py | Python | gfapy/alignment/cigar.py | ujjwalsh/gfapy | 891ef3df695f20c67809e5a54549c876d90690b4 | [
"ISC"
] | 44 | 2017-03-18T08:08:04.000Z | 2021-11-10T16:11:15.000Z | gfapy/alignment/cigar.py | ujjwalsh/gfapy | 891ef3df695f20c67809e5a54549c876d90690b4 | [
"ISC"
] | 22 | 2017-04-04T21:20:31.000Z | 2022-03-09T19:05:30.000Z | gfapy/alignment/cigar.py | ujjwalsh/gfapy | 891ef3df695f20c67809e5a54549c876d90690b4 | [
"ISC"
] | 5 | 2017-07-07T02:56:56.000Z | 2020-09-30T20:10:49.000Z | import re
import gfapy
class CIGAR(list):
"""
Representation of the contents of a CIGAR string.
Each operation is represented by a
:class:`CIGAR.Operation <gfapy.alignment.cigar.CIGAR.Operation>`,
which specifies an operation length and operation symbol.
Instances are usually created from their string re... | 30.583756 | 80 | 0.61195 |
bcdf6c107a02f1ed779b37f4bb97ea803fc3024d | 14,947 | py | Python | train.py | bryanlimy/mri-super-resolution | 9aa846dc3ee817b0188518b1fd0effe1fd33e043 | [
"MIT"
] | 3 | 2021-04-20T11:22:46.000Z | 2021-05-15T08:40:45.000Z | train.py | bryanlimy/mri-super-resolution | 9aa846dc3ee817b0188518b1fd0effe1fd33e043 | [
"MIT"
] | 1 | 2021-10-14T09:14:57.000Z | 2021-10-14T10:40:31.000Z | train.py | bryanlimy/mri-super-resolution | 9aa846dc3ee817b0188518b1fd0effe1fd33e043 | [
"MIT"
] | 1 | 2021-05-15T08:40:55.000Z | 2021-05-15T08:40:55.000Z | import torch
import argparse
import numpy as np
from time import time
from tqdm import tqdm
from pathlib import Path
from shutil import rmtree
import torch.optim as optim
import torch.nn.functional as F
from torch.optim.lr_scheduler import StepLR
from torch.cuda.amp import autocast, GradScaler
from slowMRI.utils impor... | 36.456098 | 80 | 0.543855 |
5711d67506695bfaec17428f766dab03b47acf1c | 1,362 | py | Python | build/caster_description/catkin_generated/generate_cached_setup.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | build/caster_description/catkin_generated/generate_cached_setup.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | build/caster_description/catkin_generated/generate_cached_setup.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.... | 43.935484 | 105 | 0.742291 |
8052b0a3950461145e9592cb2d2f258efacfc17b | 425 | py | Python | authors/apps/authentication/signals.py | Kasulejoseph/ah-backend-athena | 016810d6a2391ae45985b4d43003e51ada1e81be | [
"BSD-3-Clause"
] | null | null | null | authors/apps/authentication/signals.py | Kasulejoseph/ah-backend-athena | 016810d6a2391ae45985b4d43003e51ada1e81be | [
"BSD-3-Clause"
] | 31 | 2018-11-26T17:42:35.000Z | 2022-03-11T23:36:55.000Z | authors/apps/authentication/signals.py | Kasulejoseph/ah-backend-athena | 016810d6a2391ae45985b4d43003e51ada1e81be | [
"BSD-3-Clause"
] | 6 | 2018-11-23T09:55:02.000Z | 2021-06-17T15:18:49.000Z | from django.db.models.signals import post_save
from django.dispatch import receiver
from authors.apps.profiles.models import Profile
from .models import User
@receiver(post_save, sender=User)
def create_related_profile(sender, instance, created, *args, **kwargs):
"""
Create a user profile when signal is ru... | 25 | 71 | 0.745882 |
0aef38ae5e27af6b02f354d1821a5129492f610a | 9,305 | py | Python | hashtagger/hashtagger.py | nichelia/docker-hashtagger | 43e16144f2939f79b60f1e1d84b58f6be5af067d | [
"MIT"
] | 1 | 2018-11-22T11:05:35.000Z | 2018-11-22T11:05:35.000Z | hashtagger/hashtagger.py | nichelia/docker-hashtagger | 43e16144f2939f79b60f1e1d84b58f6be5af067d | [
"MIT"
] | null | null | null | hashtagger/hashtagger.py | nichelia/docker-hashtagger | 43e16144f2939f79b60f1e1d84b58f6be5af067d | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys, os, urllib, time, logging
import nltk
import tika
tika.initVM()
from texttable import Texttable
from tika import parser
script_name = 'hashtagger.py'
logging.getLogger().setLevel(logging.INFO)
class FileInterpreter:
"""
Responsible for reading a file,
using either python io ... | 33.351254 | 77 | 0.634605 |
d9538c23afc0b8114d752d003964759024af39a3 | 4,252 | py | Python | circlecover/compute_antenna_cover.py | usnistgov/esc-antenna-cover | 1bd391bc8095a2b9b277a453d3b7a19a6300a84c | [
"Unlicense"
] | 1 | 2021-02-19T22:22:22.000Z | 2021-02-19T22:22:22.000Z | circlecover/compute_antenna_cover.py | usnistgov/esc-antenna-cover | 1bd391bc8095a2b9b277a453d3b7a19a6300a84c | [
"Unlicense"
] | null | null | null | circlecover/compute_antenna_cover.py | usnistgov/esc-antenna-cover | 1bd391bc8095a2b9b277a453d3b7a19a6300a84c | [
"Unlicense"
] | 1 | 2019-11-21T02:38:17.000Z | 2019-11-21T02:38:17.000Z | # This software was developed by employees of the National Institute
# of Standards and Technology (NIST), an agency of the Federal
# Government. Pursuant to title 17 United States Code Section 105, works
# of NIST employees are not subject to copyright protection in the United
# States and are considered to be in the ... | 48.873563 | 147 | 0.742239 |
080f26000d833a55f84b4e1565db72fd73295f9d | 32,753 | py | Python | lib/spack/spack/test/spec_dag.py | mtmiller/spack | c97c135f1dbe24955048fcc4f0f98281ef0c9300 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-11-16T02:42:57.000Z | 2019-06-06T19:18:50.000Z | lib/spack/spack/test/spec_dag.py | mtmiller/spack | c97c135f1dbe24955048fcc4f0f98281ef0c9300 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | lib/spack/spack/test/spec_dag.py | mtmiller/spack | c97c135f1dbe24955048fcc4f0f98281ef0c9300 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-07-19T20:31:27.000Z | 2021-07-19T21:14:14.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
These tests check Spec DAG operations using dummy packages.
"""
import pytest
import spack.architecture
import spack.e... | 33.218053 | 79 | 0.560285 |
66beedf769e23a8e57a034298ae78269da972e67 | 988 | py | Python | tests/test_unit/test_add.py | kvg/pydm | 6e2994e169db63d69b61686301b6fcd8f04f4010 | [
"MIT"
] | null | null | null | tests/test_unit/test_add.py | kvg/pydm | 6e2994e169db63d69b61686301b6fcd8f04f4010 | [
"MIT"
] | 5 | 2017-06-29T11:38:17.000Z | 2020-03-31T00:29:49.000Z | tests/test_unit/test_add.py | kvg/pydm | 6e2994e169db63d69b61686301b6fcd8f04f4010 | [
"MIT"
] | 1 | 2017-06-14T15:39:07.000Z | 2017-06-14T15:39:07.000Z | import io
import pytest
from dmpy import DistributedMake
class TestDmpyAdd(object):
def test_raises_on_adding_same_target_twice(self):
# given
dm = DistributedMake()
dm.add('hi', 'world', 'echo')
# when
with pytest.raises(Exception) as excinfo:
dm.add('hi', '... | 24.7 | 69 | 0.59919 |
a26652b904fa5c4560333d60b91c7846479825fc | 341 | py | Python | migrations/versions/90a9015b6406_new.py | syth0le/async_cookeat | 0cecdd44c064be6fe19c0d0ae8342d7baf5a9bb8 | [
"CC0-1.0"
] | null | null | null | migrations/versions/90a9015b6406_new.py | syth0le/async_cookeat | 0cecdd44c064be6fe19c0d0ae8342d7baf5a9bb8 | [
"CC0-1.0"
] | null | null | null | migrations/versions/90a9015b6406_new.py | syth0le/async_cookeat | 0cecdd44c064be6fe19c0d0ae8342d7baf5a9bb8 | [
"CC0-1.0"
] | null | null | null | """new
Revision ID: 90a9015b6406
Revises: 494340202f18
Create Date: 2021-08-23 15:09:14.459946
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '90a9015b6406'
down_revision = '494340202f18'
branch_labels = None
depends_on = None
def upgrade():
pass
def d... | 13.64 | 40 | 0.73607 |
1eecadc662169e9ca11c8d3ae2b0aa084a2f2c23 | 679 | py | Python | test.py | avrogachev/vk_quest_bot | 9728d600302db514f1c71784b3b67804994cc46a | [
"MIT"
] | 3 | 2019-10-01T13:52:07.000Z | 2020-09-07T17:39:02.000Z | test.py | avrogachev/vk_quest_bot | 9728d600302db514f1c71784b3b67804994cc46a | [
"MIT"
] | 1 | 2019-10-01T13:55:53.000Z | 2019-10-01T14:19:50.000Z | test.py | avrogachev/vk_quest_bot | 9728d600302db514f1c71784b3b67804994cc46a | [
"MIT"
] | null | null | null | from vk import VK
from vk.utils import TaskManager
from vk.bot_framework import Dispatcher, rules
from vk.bot_framework import BaseRule, BaseMiddleware
from vk import types
import logging
from config import TOKEN, GROUP_ID # PLUGINS_PATH #, loop
from keyboards import *
logging.basicConfig(level="DEBUG")
vk = VK(TO... | 19.4 | 58 | 0.745214 |
ac5ca927faeafec46fcd049695ea34fd4119c30a | 3,516 | py | Python | esovalue/trinomial_tree.py | snthibaud/esovalue | 9d0ed07a85e58637c17fd595c63ebf4fb0d4ac22 | [
"MIT"
] | 2 | 2022-01-26T19:56:30.000Z | 2022-02-09T01:20:22.000Z | esovalue/trinomial_tree.py | snthibaud/esovalue | 9d0ed07a85e58637c17fd595c63ebf4fb0d4ac22 | [
"MIT"
] | null | null | null | esovalue/trinomial_tree.py | snthibaud/esovalue | 9d0ed07a85e58637c17fd595c63ebf4fb0d4ac22 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Optional
from mpmath import mpf, ln, mp
ONE = mpf("1")
ZERO = mpf("0")
@dataclass
class TrinomialNode:
stock_value: Optional[mpf] = None
option_value: Optional[mpf] = None
up: Optional['TrinomialNode'] = None
middle: Optional['TrinomialNode'] = Non... | 32.555556 | 109 | 0.544653 |
b474eb138f09a6b6fea0f45964a8f8a77732ea10 | 449 | py | Python | gunicorn.conf.py | richardzilincikPantheon/bottle-yang-extractor-validator | 12cb99bf8b0bde2d14c351695c4ad4b1a0665dd8 | [
"BSD-2-Clause"
] | 4 | 2019-06-15T03:11:41.000Z | 2021-06-29T05:34:59.000Z | gunicorn.conf.py | richardzilincikPantheon/bottle-yang-extractor-validator | 12cb99bf8b0bde2d14c351695c4ad4b1a0665dd8 | [
"BSD-2-Clause"
] | 39 | 2019-07-08T06:58:26.000Z | 2021-10-06T11:39:25.000Z | gunicorn.conf.py | richardzilincikPantheon/bottle-yang-extractor-validator | 12cb99bf8b0bde2d14c351695c4ad4b1a0665dd8 | [
"BSD-2-Clause"
] | 7 | 2019-09-18T15:08:26.000Z | 2021-12-12T13:56:05.000Z |
bind = "unix:/var/run/yang/yangvalidator.sock"
#umask = os.umask('007')
workers = 2
max_requests = 1000
timeout = 300
keep_alive = 2
#user = 'yang'
#group = 'yang'
preload = True
accesslog = '/var/yang/logs/uwsgi/yang-validator-access.log'
errorlog = '/var/yang/logs/uwsgi/yang-validator-error.log'
loglevel = 'deb... | 20.409091 | 81 | 0.659243 |
85ee568b42aee238842cd9390f9b1e00e31982db | 284 | py | Python | ExampleSlice/learnSlice.py | subash-kc/2022-01-04-Python | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | [
"MIT"
] | 1 | 2022-01-14T18:03:42.000Z | 2022-01-14T18:03:42.000Z | ExampleSlice/learnSlice.py | subash-kc/2022-01-04-Python | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | [
"MIT"
] | null | null | null | ExampleSlice/learnSlice.py | subash-kc/2022-01-04-Python | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | [
"MIT"
] | null | null | null | website1 = "http://localhost:3000"
slice_local = slice(7, -5)
print(website1[slice_local])
website2 = "http://google.com"
slice_google = slice(7, -4)
print(website2[slice_google])
website3 = "http://wikipedia.com"
slice_wikipedia = slice(7, -4)
print(website3[slice_wikipedia]) | 17.75 | 34 | 0.725352 |
1fce3e6dc5debe0080aaa3f193f2a363f6d04946 | 126 | py | Python | ktrain/__init__.py | sathishksankarpandi/ktrain | bc9169661592ee14b95d9e56622dbb20e66b3568 | [
"MIT"
] | null | null | null | ktrain/__init__.py | sathishksankarpandi/ktrain | bc9169661592ee14b95d9e56622dbb20e66b3568 | [
"MIT"
] | null | null | null | ktrain/__init__.py | sathishksankarpandi/ktrain | bc9169661592ee14b95d9e56622dbb20e66b3568 | [
"MIT"
] | null | null | null | from .version import __version__
from .core import *
__all__ = ['get_learner', 'ArrayTrainer', 'GenTrainer', 'get_predictor']
| 31.5 | 72 | 0.753968 |
ad8be1c431eeb77cea57975f7f209ce38fa477f6 | 635 | py | Python | client/data/electricity_master_lookup_to_json.py | yangsiyu007/event-footprint | 5e629ae69822c666f70edeb71de2d3dea3eda4ba | [
"MIT"
] | null | null | null | client/data/electricity_master_lookup_to_json.py | yangsiyu007/event-footprint | 5e629ae69822c666f70edeb71de2d3dea3eda4ba | [
"MIT"
] | 2 | 2021-05-11T08:34:11.000Z | 2022-02-18T23:50:43.000Z | client/data/electricity_master_lookup_to_json.py | yangsiyu007/event-footprint | 5e629ae69822c666f70edeb71de2d3dea3eda4ba | [
"MIT"
] | null | null | null | """
Convert a CSV version of the Electricity Master Lookup table to a JSON
"""
import json
import pandas as pd
with open('electricity_master_lookup.csv') as f:
csv_table = pd.read_csv(f, header=0)
print(csv_table.head(5))
json_table = {} # "Electric Subregion" to "t CO2e / kWh"
for i, row in csv_table.iterr... | 25.4 | 85 | 0.699213 |
f198f6397c37e45f536281c27bdd9f5a88f06e94 | 10,263 | py | Python | kubestrike/service_discovery.py | tpoindessous/kubestrike | 7fb3a80d1f961b974e0f9360399185ab7b7f1fcf | [
"MIT"
] | 1 | 2021-08-03T10:12:13.000Z | 2021-08-03T10:12:13.000Z | kubestrike/service_discovery.py | tpoindessous/kubestrike | 7fb3a80d1f961b974e0f9360399185ab7b7f1fcf | [
"MIT"
] | 3 | 2021-11-14T14:41:24.000Z | 2021-11-14T16:03:54.000Z | kubestrike/service_discovery.py | tpoindessous/kubestrike | 7fb3a80d1f961b974e0f9360399185ab7b7f1fcf | [
"MIT"
] | null | null | null | import socket
import warnings
from kubestrike.bars import prefix, sub_prefix, service_open, print_msg_box
warnings.filterwarnings("ignore")
class ServiceDiscovery(object):
def __init__(self,file_object):
self.result = {}
self.service_discovery_status = []
self.file_obj = file_object
d... | 47.513889 | 129 | 0.535711 |
d3b415c8dba1649d5f6a2b1ac86ee84ad9b47c3c | 930 | py | Python | isi_sdk_8_0_1/test/test_smb_log_level_filters.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_0_1/test/test_smb_log_level_filters.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_0_1/test/test_smb_log_level_filters.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 4
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_0_1
from i... | 22.682927 | 95 | 0.713978 |
796846d565a0f7c7da3a08ddc8c88b9ba2522c75 | 62,147 | py | Python | test/functional/test_object.py | smerritt/swift | c4751d0d551ad193a205c71821f6770a31146421 | [
"Apache-2.0"
] | null | null | null | test/functional/test_object.py | smerritt/swift | c4751d0d551ad193a205c71821f6770a31146421 | [
"Apache-2.0"
] | 12 | 2015-06-23T23:20:17.000Z | 2016-01-27T00:37:12.000Z | test/functional/test_object.py | smerritt/swift | c4751d0d551ad193a205c71821f6770a31146421 | [
"Apache-2.0"
] | 5 | 2015-06-04T19:00:11.000Z | 2015-12-16T21:04:33.000Z | #!/usr/bin/python
# Copyright (c) 2010-2012 OpenStack 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 appl... | 37.619249 | 79 | 0.525078 |
e6be50b4825d1d47f14ea525eb7f25a4a9bb0a68 | 5,359 | py | Python | tests/test_cli.py | yaal-coop/sheraf | 774e3781bc6ff2e16c6cc39f268d475b5e64fcea | [
"MIT"
] | null | null | null | tests/test_cli.py | yaal-coop/sheraf | 774e3781bc6ff2e16c6cc39f268d475b5e64fcea | [
"MIT"
] | null | null | null | tests/test_cli.py | yaal-coop/sheraf | 774e3781bc6ff2e16c6cc39f268d475b5e64fcea | [
"MIT"
] | null | null | null | import re
import sheraf
from click.testing import CliRunner
from sheraf.cli import cli
class CliModel(sheraf.Model):
table = "climymodel"
foo = sheraf.StringAttribute().index()
boo = sheraf.StringAttribute().index()
def test_healthcheck_conflict_resolution(sheraf_zeo_database):
with sheraf.connecti... | 29.284153 | 88 | 0.591715 |
176018f54b057f8d07b980313c543fba4fe9fcf2 | 7,735 | py | Python | selfdrive/car/subaru/carstate.py | StingrayCharles/openpilot | 6a48212422ef05792dde058e36c5c3099f17f619 | [
"MIT"
] | 23 | 2018-08-17T11:02:00.000Z | 2020-12-23T01:46:44.000Z | selfdrive/car/subaru/carstate.py | StingrayCharles/openpilot | 6a48212422ef05792dde058e36c5c3099f17f619 | [
"MIT"
] | 2 | 2020-04-14T22:39:11.000Z | 2020-05-03T19:17:40.000Z | selfdrive/car/subaru/carstate.py | StingrayCharles/openpilot | 6a48212422ef05792dde058e36c5c3099f17f619 | [
"MIT"
] | 44 | 2018-07-31T04:26:19.000Z | 2021-01-08T22:46:30.000Z | import copy
from selfdrive.config import Conversions as CV
from selfdrive.car.interfaces import CarStateBase
from opendbc.can.parser import CANParser
from selfdrive.car.subaru.values import CAR, DBC, STEER_THRESHOLD
def get_powertrain_can_parser(CP):
# this function generates lists for signal, messages and initial v... | 37.36715 | 133 | 0.649386 |
f8941b952d9f39ea79724c163d9bd18875d87d13 | 4,935 | py | Python | tests/trinity/core/p2p-proto/test_block_bodies_request_object.py | pipermerriam/py-evm | 5a52ce035d77483577395a18f782b42ca78de77b | [
"MIT"
] | 137 | 2017-03-17T11:37:51.000Z | 2022-03-07T07:51:28.000Z | tests/trinity/core/p2p-proto/test_block_bodies_request_object.py | retzger/py-evm | 5a52ce035d77483577395a18f782b42ca78de77b | [
"MIT"
] | 102 | 2017-04-07T10:43:03.000Z | 2018-11-11T18:01:56.000Z | tests/trinity/core/p2p-proto/test_block_bodies_request_object.py | retzger/py-evm | 5a52ce035d77483577395a18f782b42ca78de77b | [
"MIT"
] | 39 | 2017-03-17T11:38:52.000Z | 2021-02-18T23:05:17.000Z | import os
import random
import time
import pytest
import rlp
from eth_hash.auto import keccak
from eth_utils import (
to_tuple,
big_endian_to_int,
)
from eth.db.trie import make_trie_root_and_nodes
from eth.rlp.headers import BlockHeader
from eth.rlp.transactions import BaseTransactionFields
from p2p.exce... | 34.270833 | 94 | 0.721581 |
9c8994f783b9f06bb12e5c323255fd1caa993a91 | 837 | py | Python | setup.py | TauAkiou/msi-perkeyrgb | 87c92ac23a81372a2ad604a7421bf0da6dbc4f08 | [
"MIT"
] | 2 | 2019-10-14T18:13:12.000Z | 2021-03-08T17:53:46.000Z | setup.py | TauAkiou/msi-perkeyrgb | 87c92ac23a81372a2ad604a7421bf0da6dbc4f08 | [
"MIT"
] | 1 | 2019-11-04T18:07:12.000Z | 2019-11-04T18:07:12.000Z | setup.py | TauAkiou/msi-perkeyrgb | 87c92ac23a81372a2ad604a7421bf0da6dbc4f08 | [
"MIT"
] | 4 | 2019-10-25T01:38:10.000Z | 2022-01-03T16:25:08.000Z | #!/usr/bin/env python
from os.path import dirname, join
from setuptools import setup
setup(
name='msi-perkeyrgb',
version='1.4-effect-alpha',
description='Configuration tool for per-key RGB keyboards on MSI laptops.',
long_description=open(
join(dirname(__file__), 'README.md')).read(),
url... | 28.862069 | 79 | 0.626045 |
34f80297153704881595a340a09c090274cebdb6 | 3,051 | py | Python | sdk/core/azure-core/tests/testserver_tests/test_rest_context_manager.py | hugovk/azure-sdk-for-python | 728b28b5489f46548eb8db200a49927881c282c1 | [
"MIT"
] | 1 | 2021-04-26T21:15:01.000Z | 2021-04-26T21:15:01.000Z | sdk/core/azure-core/tests/testserver_tests/test_rest_context_manager.py | hugovk/azure-sdk-for-python | 728b28b5489f46548eb8db200a49927881c282c1 | [
"MIT"
] | 2 | 2021-08-24T15:32:30.000Z | 2021-08-24T23:21:34.000Z | sdk/core/azure-core/tests/testserver_tests/test_rest_context_manager.py | paikend/azure-sdk-for-python | 5772d14728569fce7b40552a0f20795d12ecd797 | [
"MIT"
] | null | null | null | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | 38.620253 | 92 | 0.647984 |
16fab29c1af07380441a4f3bb86cd75114364f72 | 4,399 | py | Python | pip_services3_commons/reflect/TypeDescriptor.py | pip-services3-python/pip-services3-commons-python | c33cc9a04c296acf17f7e6a303dd417931559bce | [
"MIT"
] | null | null | null | pip_services3_commons/reflect/TypeDescriptor.py | pip-services3-python/pip-services3-commons-python | c33cc9a04c296acf17f7e6a303dd417931559bce | [
"MIT"
] | null | null | null | pip_services3_commons/reflect/TypeDescriptor.py | pip-services3-python/pip-services3-commons-python | c33cc9a04c296acf17f7e6a303dd417931559bce | [
"MIT"
] | 2 | 2020-03-11T21:41:13.000Z | 2020-03-14T00:26:20.000Z | # -*- coding: utf-8 -*-
"""
pip_services3_commons.reflect.TypeDescriptor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Type descriptor implementation
:copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from ty... | 32.345588 | 102 | 0.60241 |
16f131405a0b2a5566dafa2d3d59f7d7c8fe9cea | 1,256 | py | Python | migrations/versions/9005ab594598_add_lettertemplates.py | CityOfNewYork/NYCOpenRecords | 476a236a573e6f3a2f96c6537a30ee27b2bd3a2b | [
"Apache-2.0"
] | 37 | 2016-01-21T18:33:56.000Z | 2021-10-24T01:43:20.000Z | migrations/versions/9005ab594598_add_lettertemplates.py | CityOfNewYork/NYCOpenRecords | 476a236a573e6f3a2f96c6537a30ee27b2bd3a2b | [
"Apache-2.0"
] | 179 | 2016-01-21T21:33:31.000Z | 2022-02-15T21:31:35.000Z | migrations/versions/9005ab594598_add_lettertemplates.py | CityOfNewYork/NYCOpenRecords | 476a236a573e6f3a2f96c6537a30ee27b2bd3a2b | [
"Apache-2.0"
] | 13 | 2017-05-19T17:27:31.000Z | 2020-07-05T00:55:29.000Z | """Add LetterTemplates
Revision ID: 9005ab594598
Revises: 949aebe9e480
Create Date: 2018-03-20 18:41:57.143317
"""
# revision identifiers, used by Alembic.
revision = "9005ab594598"
down_revision = "949aebe9e480"
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alem... | 26.166667 | 68 | 0.57086 |
b80ab44034babe45940c7556f292d6d5ad26955c | 423 | py | Python | users/admin.py | uoe-compsci-grp30/campusgame | d2d7ba99210f352a7b45a1db06cea0a09e3b8c31 | [
"MIT"
] | null | null | null | users/admin.py | uoe-compsci-grp30/campusgame | d2d7ba99210f352a7b45a1db06cea0a09e3b8c31 | [
"MIT"
] | null | null | null | users/admin.py | uoe-compsci-grp30/campusgame | d2d7ba99210f352a7b45a1db06cea0a09e3b8c31 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import gettext_lazy
from users.models import User, GameParticipation
# Register your models here.
class MUserAdmin(UserAdmin):
fieldsets = UserAdmin.fieldsets + ((gettext_lazy("Zones stuff"), {"fields":... | 28.2 | 102 | 0.789598 |
68b37a20c7f0856430903101ba71b51173953264 | 2,304 | py | Python | tests/sdk/query/test_top.py | ObliviousAI/smartnoise-sdk | 6c5b9bdd16852a08ee01299193a1fac93def99cd | [
"MIT"
] | null | null | null | tests/sdk/query/test_top.py | ObliviousAI/smartnoise-sdk | 6c5b9bdd16852a08ee01299193a1fac93def99cd | [
"MIT"
] | null | null | null | tests/sdk/query/test_top.py | ObliviousAI/smartnoise-sdk | 6c5b9bdd16852a08ee01299193a1fac93def99cd | [
"MIT"
] | null | null | null | import os
import subprocess
import copy
import pytest
import pandas as pd
from pandasql import sqldf
import math
from opendp.smartnoise.metadata import CollectionMetadata
from opendp.smartnoise.sql import PrivateReader, PandasReader
from opendp.smartnoise.sql.parse import QueryParser
git_root_dir = subprocess.check_... | 40.421053 | 148 | 0.656684 |
b8353f160841dcf1ab28bbaefd491cdeab4bd309 | 6,623 | py | Python | api/logistics/serializers.py | abhinavtripathy/Volog | 8b4eb02b18bfc6d8689def9b9037325ccd3d871e | [
"MIT"
] | null | null | null | api/logistics/serializers.py | abhinavtripathy/Volog | 8b4eb02b18bfc6d8689def9b9037325ccd3d871e | [
"MIT"
] | null | null | null | api/logistics/serializers.py | abhinavtripathy/Volog | 8b4eb02b18bfc6d8689def9b9037325ccd3d871e | [
"MIT"
] | null | null | null | """
File Name: Serializers
Purpose: Serializers for translating database data before sending it over the API.
Comments:
"""
from django.db.models import Sum
from rest_framework import serializers
from rest_framework.fields import empty
from api.models import BugReport, FeedbackForm
from api.models import Student, Ment... | 40.882716 | 120 | 0.691831 |
4b79104da37498b8b3a326ff8c89df6d7f52dbfa | 6,368 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/cs/cspolicy_cspolicylabel_binding.py | mahabs/nitro | be74e1e177f5c205c16126bc9b023f2348788409 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/cs/cspolicy_cspolicylabel_binding.py | mahabs/nitro | be74e1e177f5c205c16126bc9b023f2348788409 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/cs/cspolicy_cspolicylabel_binding.py | mahabs/nitro | be74e1e177f5c205c16126bc9b023f2348788409 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2008-2015 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 l... | 28.684685 | 219 | 0.718593 |
a85eabb40740dd9e3ea8c93f8345887ee8867fdd | 167 | py | Python | lecture_5/07/typing2.py | darinabird/python_developer | 7141c9e4d0deb5f2943d70eaf189316631942e56 | [
"CC0-1.0"
] | 20 | 2020-03-04T17:26:47.000Z | 2022-03-27T20:47:37.000Z | lecture_5/07/typing2.py | darinabird/python_developer | 7141c9e4d0deb5f2943d70eaf189316631942e56 | [
"CC0-1.0"
] | 3 | 2020-03-17T17:39:36.000Z | 2020-03-31T16:01:23.000Z | lecture_5/07/typing2.py | darinabird/python_developer | 7141c9e4d0deb5f2943d70eaf189316631942e56 | [
"CC0-1.0"
] | 47 | 2020-03-04T17:31:26.000Z | 2022-03-13T15:40:27.000Z | from typing import Union, Dict
def some_func(arg: Union[Dict[str, str], str]) -> int:
return len(arg)
some_func({"a": "b"})
some_func("abc")
some_func({"a": 1}) | 18.555556 | 54 | 0.640719 |
474ba8f0da949dd5937f968dab287593e5eb0abf | 4,577 | py | Python | tf_pose/common.py | McgBcg/MomchigiBakchigi | 97084b44e80852503827816c64f0eb4fdf81b1a5 | [
"Apache-2.0"
] | 1 | 2021-02-03T11:23:32.000Z | 2021-02-03T11:23:32.000Z | tf_pose/common.py | McgBcg/MomchigiBakchigi | 97084b44e80852503827816c64f0eb4fdf81b1a5 | [
"Apache-2.0"
] | null | null | null | tf_pose/common.py | McgBcg/MomchigiBakchigi | 97084b44e80852503827816c64f0eb4fdf81b1a5 | [
"Apache-2.0"
] | 1 | 2021-02-04T03:32:36.000Z | 2021-02-04T03:32:36.000Z | from enum import Enum
import tensorflow as tf
import cv2
regularizer_conv = 0.004
regularizer_dsconv = 0.0004
batchnorm_fused = True
activation_fn = tf.nn.relu
class CocoPart(Enum):
Nose = 0
Neck = 1
RShoulder = 2
RElbow = 3
RWrist = 4
LShoulder = 5
LElbow = 6
LWrist = 7
RHip = ... | 29.152866 | 100 | 0.502731 |
f5eda41b005dd08d583a37f3eea3d4097f62d86e | 239 | py | Python | tests/test_mapper.py | sourcepirate/yql | 16ebf3674cef74e0b15e026dbcb69d500e3cafd9 | [
"MIT"
] | 1 | 2015-10-26T09:26:14.000Z | 2015-10-26T09:26:14.000Z | tests/test_mapper.py | plasmashadow/yql | 16ebf3674cef74e0b15e026dbcb69d500e3cafd9 | [
"MIT"
] | 2 | 2015-09-17T03:04:42.000Z | 2016-11-27T03:34:31.000Z | tests/test_mapper.py | sourcepirate/yql | 16ebf3674cef74e0b15e026dbcb69d500e3cafd9 | [
"MIT"
] | 4 | 2015-08-24T11:25:14.000Z | 2016-11-10T04:30:29.000Z | import unittest
from yql.api._api_mapper import ObjectMapper
class TestMapper(unittest.TestCase):
def test_mapper(self):
a = {"a":"b", "c":{"d":"3"}}
obj = ObjectMapper(a)
self.assertEqual(obj.c.d,"3")
| 14.058824 | 44 | 0.606695 |
fc61d387f37723a0e84038de5d4ce4ab7bcba8eb | 37,550 | py | Python | nncf/config_schema.py | AbraInsight/nncf_pytorch | 5e8d72d5e2f0c30da05d95cd9c3b3d8832ac8572 | [
"Apache-2.0"
] | null | null | null | nncf/config_schema.py | AbraInsight/nncf_pytorch | 5e8d72d5e2f0c30da05d95cd9c3b3d8832ac8572 | [
"Apache-2.0"
] | null | null | null | nncf/config_schema.py | AbraInsight/nncf_pytorch | 5e8d72d5e2f0c30da05d95cd9c3b3d8832ac8572 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2020 Intel Corporation
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 writin... | 57.415902 | 120 | 0.463249 |
55525f956af9d66ba722c4708c2d15e81ed5cd6d | 918 | py | Python | bubbleSort.py | ManishSreerangam/SortingAlgorithms | 542b729353e2740e8baa6e88ac1adc8bd84dfd43 | [
"Apache-2.0"
] | null | null | null | bubbleSort.py | ManishSreerangam/SortingAlgorithms | 542b729353e2740e8baa6e88ac1adc8bd84dfd43 | [
"Apache-2.0"
] | null | null | null | bubbleSort.py | ManishSreerangam/SortingAlgorithms | 542b729353e2740e8baa6e88ac1adc8bd84dfd43 | [
"Apache-2.0"
] | null | null | null | """
Bubble sort : The bubble sort algorithm repeatedly scans through the list,
comparing adjacent elements and swapping them if they are in wrong order.
"""
def bubble(list1):
for i in range(1 ,x): #number of passes n-1 passes
for j in range(0 , x-i ): #comparison .. x-i because there is no need ... | 38.25 | 121 | 0.570806 |
5f3530c2b5fc9b1bb4c839fe57e5967423721571 | 3,125 | py | Python | airflow/ti_deps/deps/ready_to_reschedule.py | daemon-demon/airflow | 6f96e81f0123b30750fb68ec496246023bf63f35 | [
"Apache-2.0"
] | 1 | 2020-09-15T02:32:55.000Z | 2020-09-15T02:32:55.000Z | airflow/ti_deps/deps/ready_to_reschedule.py | daemon-demon/airflow | 6f96e81f0123b30750fb68ec496246023bf63f35 | [
"Apache-2.0"
] | 20 | 2021-01-23T12:33:08.000Z | 2021-12-07T22:30:37.000Z | airflow/ti_deps/deps/ready_to_reschedule.py | daemon-demon/airflow | 6f96e81f0123b30750fb68ec496246023bf63f35 | [
"Apache-2.0"
] | 2 | 2020-03-08T14:12:55.000Z | 2020-06-10T10:17:32.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.118421 | 102 | 0.6896 |
11bf0939164121ee93e421d30a079b1874b2ec94 | 16,117 | py | Python | spare/consensus/multiprocess_validation.py | zcomputerwiz/sparev2-blockchain | ce4344321de909704ad8df9785299da25761059e | [
"Apache-2.0"
] | 3 | 2021-11-20T16:21:45.000Z | 2022-02-09T04:33:04.000Z | spare/consensus/multiprocess_validation.py | zcomputerwiz/sparev2-blockchain | ce4344321de909704ad8df9785299da25761059e | [
"Apache-2.0"
] | null | null | null | spare/consensus/multiprocess_validation.py | zcomputerwiz/sparev2-blockchain | ce4344321de909704ad8df9785299da25761059e | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import traceback
from concurrent.futures.process import ProcessPoolExecutor
from dataclasses import dataclass
from typing import Dict, List, Optional, Sequence, Tuple, Union, Callable
from spare.consensus.block_header_validation import validate_finished_header_block
from spare.consensus.b... | 45.917379 | 117 | 0.665633 |
28b80ab8923fa4a057c4bf3c7a889ccc3db28b21 | 2,051 | py | Python | aizynthfinder/training/preprocess_recommender.py | 0x2b3bfa0/aizynthfinder | 3f1536e8947adcfc8b2603709eecc7895e48d42d | [
"MIT"
] | 1 | 2021-11-19T04:32:51.000Z | 2021-11-19T04:32:51.000Z | aizynthfinder/training/preprocess_recommender.py | 0x2b3bfa0/aizynthfinder | 3f1536e8947adcfc8b2603709eecc7895e48d42d | [
"MIT"
] | null | null | null | aizynthfinder/training/preprocess_recommender.py | 0x2b3bfa0/aizynthfinder | 3f1536e8947adcfc8b2603709eecc7895e48d42d | [
"MIT"
] | null | null | null | """ Module routines for pre-processing data for recommender training
"""
import argparse
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelBinarizer
from scipy import sparse
from aizynthfinder.training.utils import (
Config,
split_and_save_data,
reactants_to_fingerprint,
)
de... | 31.553846 | 90 | 0.724525 |
f34f250d3d8239e6393e5ee5573fedb1a86aa533 | 3,866 | py | Python | cipher/model_zoo/cnn_dist.py | nkl27/cipher | f7b5795cc7369a6b6811e0ee5f77c6892e327ab4 | [
"MIT"
] | null | null | null | cipher/model_zoo/cnn_dist.py | nkl27/cipher | f7b5795cc7369a6b6811e0ee5f77c6892e327ab4 | [
"MIT"
] | null | null | null | cipher/model_zoo/cnn_dist.py | nkl27/cipher | f7b5795cc7369a6b6811e0ee5f77c6892e327ab4 | [
"MIT"
] | null | null | null |
from tensorflow import keras
def cnn_dist_model(input_shape, output_shape, activation='relu', units=[24, 32, 48, 64, 96 ], dropout=[0.1, 0.2, 0.3, 0.4, 0.5]):
"""
Creates a keras neural network with the architecture shown below. The architecture is chosen to promote learning in a distributive way.
... | 38.66 | 194 | 0.539317 |
fbcd892c43991d12a935861e3d405a2715e5c239 | 8,782 | py | Python | backend/handlers/predictions.py | Bob620/superman-web | e13ae7305962cd348c2af74485ffa3e0b6855c02 | [
"MIT"
] | null | null | null | backend/handlers/predictions.py | Bob620/superman-web | e13ae7305962cd348c2af74485ffa3e0b6855c02 | [
"MIT"
] | null | null | null | backend/handlers/predictions.py | Bob620/superman-web | e13ae7305962cd348c2af74485ffa3e0b6855c02 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, print_function, division
import logging
import numpy as np
import os
from tornado import gen
from .generic_models import GenericModelHandler, async_crossval, axes_grid
from ..models import REGRESSION_MODELS
class RegressionModelHandler(GenericModelHandler):
def get(self, fig... | 36.74477 | 79 | 0.625598 |
9e112cafc8514980ad5b73c100cb42cada82744f | 3,394 | py | Python | tools/infrt/get_compat_kernel_signature.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | tools/infrt/get_compat_kernel_signature.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | tools/infrt/get_compat_kernel_signature.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.891304 | 76 | 0.560401 |
e7e1f43af2e4ba2e33de780ac026d1551c6558b4 | 91 | py | Python | without_pkg_resources.py | scopatz/import-profiling | 13e5a8b4cce573191c4b7526ff11e91ab261c6e0 | [
"BSD-3-Clause"
] | 1 | 2017-10-12T11:52:33.000Z | 2017-10-12T11:52:33.000Z | without_pkg_resources.py | scopatz/import-profiling | 13e5a8b4cce573191c4b7526ff11e91ab261c6e0 | [
"BSD-3-Clause"
] | null | null | null | without_pkg_resources.py | scopatz/import-profiling | 13e5a8b4cce573191c4b7526ff11e91ab261c6e0 | [
"BSD-3-Clause"
] | null | null | null | import sys
sys.modules['pkg_resources'] = None
import pygments.styles
import prompt_toolkit | 22.75 | 35 | 0.835165 |
a3452f9666aadd1d7d07bd4dfaa6a11f43833b72 | 1,205 | py | Python | py_proj/server.py | maryno-net/py-project | a8db26494087a9a290553ba0bfaa692c9000dde1 | [
"MIT"
] | null | null | null | py_proj/server.py | maryno-net/py-project | a8db26494087a9a290553ba0bfaa692c9000dde1 | [
"MIT"
] | null | null | null | py_proj/server.py | maryno-net/py-project | a8db26494087a9a290553ba0bfaa692c9000dde1 | [
"MIT"
] | null | null | null | """
py_proj.server
~~~~~~~~~~~~~~
Модуль серверных приложений.
"""
import sys
from gunicorn.app.base import Application
class FlaskGunicornApplication(Application):
"""Gunicorn-приложение для py_proj."""
def __init__(self, app, config, *args, **kwargs):
#: Flask-приложение
se... | 28.023256 | 73 | 0.656432 |
ca0acfa933231de70a3c5a2d92cae9f4fd3e1ec9 | 865 | py | Python | preprocess/MLDCTD.py | bmd2007/benchmark_eval | aa42bb3369e79db4cb63e1963afcc8af6d8f5696 | [
"MIT"
] | 1 | 2022-01-11T08:03:32.000Z | 2022-01-11T08:03:32.000Z | preprocess/MLDCTD.py | bmd2007/benchmark_eval | aa42bb3369e79db4cb63e1963afcc8af6d8f5696 | [
"MIT"
] | null | null | null | preprocess/MLDCTD.py | bmd2007/benchmark_eval | aa42bb3369e79db4cb63e1963afcc8af6d8f5696 | [
"MIT"
] | null | null | null | import sys, os
currentdir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(currentdir)
from CTD_Composition import CTD_Composition
from CTD_Distribution import CTD_Distribution
from CTD_Transition import CTD_Transition
from PreprocessUtils import STDecode
from PreprocessUtils import MLDEncode
#... | 27.03125 | 107 | 0.752601 |
ca47b0e99a0953643c1ae5ba2b89367f35409dad | 552 | py | Python | molecule/default/tests/test_default.py | sys-fs/ansible-role-varnish | 0dcea0da0013c705478aba36107fb6c0ac4de47e | [
"MIT"
] | null | null | null | molecule/default/tests/test_default.py | sys-fs/ansible-role-varnish | 0dcea0da0013c705478aba36107fb6c0ac4de47e | [
"MIT"
] | null | null | null | molecule/default/tests/test_default.py | sys-fs/ansible-role-varnish | 0dcea0da0013c705478aba36107fb6c0ac4de47e | [
"MIT"
] | null | null | null | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_package(host):
pkg = host.package('varnish')
assert pkg.is_installed
def test_service(host):
service = host.service('varni... | 21.230769 | 63 | 0.721014 |
bef5da146c6478b80a0c2285d70e76df93284b90 | 25,099 | py | Python | large_queue.py | neelp-git/aerospike-large-queue | 82dc3bff0dcb94065905f9ccf566f01eaa2e127c | [
"Apache-2.0"
] | 2 | 2020-09-03T06:26:38.000Z | 2021-06-23T22:28:00.000Z | large_queue.py | neelp-git/aerospike-large-queue | 82dc3bff0dcb94065905f9ccf566f01eaa2e127c | [
"Apache-2.0"
] | null | null | null | large_queue.py | neelp-git/aerospike-large-queue | 82dc3bff0dcb94065905f9ccf566f01eaa2e127c | [
"Apache-2.0"
] | null | null | null | # large_queue.py
"""
LargeQueue
The implementation provides a rough solution for certain issues when implementing a FIFO queue or a circular buffer
in Aerospike.
1. Large queue size. The List data type in Aerospike can be easily leveraged to implement a queue. However
the maximum Aero... | 45.884826 | 119 | 0.645882 |
8f0f4dff6abb029a5854c22d72b789f15654eaf6 | 28,798 | py | Python | lib/spack/spack/test/database.py | fcannini/spack | 9b3f5f3890025494ffa620d144d22a4734c8fcee | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | lib/spack/spack/test/database.py | fcannini/spack | 9b3f5f3890025494ffa620d144d22a4734c8fcee | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2018-07-06T19:11:46.000Z | 2018-07-06T19:12:28.000Z | lib/spack/spack/test/database.py | fcannini/spack | 9b3f5f3890025494ffa620d144d22a4734c8fcee | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-06T11:04:37.000Z | 2020-03-06T11:04:37.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
These tests check the database is functioning properly,
both in memory and in its file
"""
import datetime
import func... | 33.177419 | 79 | 0.689076 |
cf79ba7e896156a665b7263fbfbcd91919ff4efa | 127,142 | py | Python | mrcnn/model.py | protohaus/Mask_RCNN | 0e1f64a9d57863f398444e2ba4a2bb547c7c83f6 | [
"MIT"
] | null | null | null | mrcnn/model.py | protohaus/Mask_RCNN | 0e1f64a9d57863f398444e2ba4a2bb547c7c83f6 | [
"MIT"
] | null | null | null | mrcnn/model.py | protohaus/Mask_RCNN | 0e1f64a9d57863f398444e2ba4a2bb547c7c83f6 | [
"MIT"
] | null | null | null | """
Mask R-CNN
The main Mask R-CNN model implementation.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import os
import datetime
import re
import math
from collections import OrderedDict
import multiprocessing
import numpy as np
import tenso... | 44.315789 | 115 | 0.613015 |
d0dc3b3be21bc4da5f2bab824a06a0c325eb6e88 | 2,064 | py | Python | components/amqpinflux/scripts/create.py | cloudify-cosmo/cloudify-manager-blueprints | 1908c1a0615fb15cbb118335aa2f9e055b9e5779 | [
"Apache-2.0"
] | 35 | 2015-03-07T13:30:58.000Z | 2022-02-14T11:44:48.000Z | components/amqpinflux/scripts/create.py | cloudify-cosmo/cloudify-manager-blueprints | 1908c1a0615fb15cbb118335aa2f9e055b9e5779 | [
"Apache-2.0"
] | 101 | 2015-03-18T03:07:57.000Z | 2019-02-07T12:06:42.000Z | components/amqpinflux/scripts/create.py | cloudify-cosmo/cloudify-manager-blueprints | 1908c1a0615fb15cbb118335aa2f9e055b9e5779 | [
"Apache-2.0"
] | 76 | 2015-01-08T10:33:03.000Z | 2021-05-11T08:45:50.000Z | #!/usr/bin/env python
import os
from os.path import join, dirname
from cloudify import ctx
ctx.download_resource(
join('components', 'utils.py'),
join(dirname(__file__), 'utils.py'))
import utils # NOQA
SERVICE_NAME = 'amqpinflux'
# Some runtime properties to be used in teardown
runtime_props = ctx.instan... | 29.913043 | 76 | 0.758721 |
3792cfbda571c1aaf89c6eeb338e53fc010f79a7 | 17,009 | py | Python | mediagoblin/media_types/pdf/processing.py | eliroca/mediagoblin-imported | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | 1 | 2021-09-21T02:24:43.000Z | 2021-09-21T02:24:43.000Z | mediagoblin/media_types/pdf/processing.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | null | null | null | mediagoblin/media_types/pdf/processing.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | 1 | 2021-09-21T02:25:20.000Z | 2021-09-21T02:25:20.000Z | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 35.959831 | 103 | 0.60274 |
3e17e75c929a40c590d0f9f90fda0af71d75d5bd | 749 | py | Python | creds.py | tbass134/audiosocket-demo | f6f6dfd426521d649cf023e417386f0725696af1 | [
"MIT"
] | 28 | 2016-12-16T12:21:21.000Z | 2022-03-03T15:16:07.000Z | creds.py | rowisahub/audiosocket-demo | 1cfc9cdfba6797b31fe1cad7d084ab78bb86125a | [
"MIT"
] | 1 | 2016-12-16T16:36:45.000Z | 2016-12-16T16:36:45.000Z | creds.py | rowisahub/audiosocket-demo | 1cfc9cdfba6797b31fe1cad7d084ab78bb86125a | [
"MIT"
] | 5 | 2017-02-22T07:39:58.000Z | 2021-08-04T00:56:35.000Z | import logging
import os
class Config(object):
def __init__(self):
self.missing_keys = []
self.api_key = self._load('API_KEY')
self.api_secret = self._load('API_SECRET')
self.app_id = self._load('APP_ID')
self.private_key = self._load('PRIVATE_KEY')
self.phone_numbe... | 28.807692 | 65 | 0.616822 |
0fbf16d2b3e2220a88b94229d00af1abf33c6e03 | 630 | py | Python | Python/Cook book/main.py | drtierney/hyperskill-problems | b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0 | [
"MIT"
] | 5 | 2020-08-29T15:15:31.000Z | 2022-03-01T18:22:34.000Z | Python/Cook book/main.py | drtierney/hyperskill-problems | b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0 | [
"MIT"
] | null | null | null | Python/Cook book/main.py | drtierney/hyperskill-problems | b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0 | [
"MIT"
] | 1 | 2020-12-02T11:13:14.000Z | 2020-12-02T11:13:14.000Z | pasta = "tomato, basil, garlic, salt, pasta, olive oil"
apple_pie = "apple, sugar, salt, cinnamon, flour, egg, butter"
ratatouille = "aubergine, carrot, onion, tomato, garlic, olive oil, pepper, salt"
chocolate_cake = "chocolate, sugar, salt, flour, coffee, butter"
omelette = "egg, milk, bacon, tomato, salt, pepper"
i... | 33.157895 | 81 | 0.71746 |
2a689497e3cd7605152f2e81c0fa3d095653246e | 7,856 | py | Python | thirdparty/blake/blake_test.py | fir3storm/Dagon | 68cc7dc84e6f496a73d53e0c01c1d56ec18f4bb5 | [
"MIT"
] | 188 | 2017-05-15T19:12:59.000Z | 2022-01-19T14:00:25.000Z | thirdparty/blake/blake_test.py | Warlockk/Dagon | f065d7bbd7598f9a8c43bd12ba6b528cfef7377e | [
"MIT"
] | 108 | 2017-05-16T11:41:57.000Z | 2019-02-01T18:53:08.000Z | thirdparty/blake/blake_test.py | Warlockk/Dagon | f065d7bbd7598f9a8c43bd12ba6b528cfef7377e | [
"MIT"
] | 62 | 2017-05-16T21:50:40.000Z | 2022-03-21T06:38:05.000Z | #!/usr/bin/env python
intro = """
blake_test.py
version 4
This program tests blake.py individually and against a C
reference implementation wrapped with blake_wrapper.py.
It works for both Python2 and Python3.
Copyright (c) 2009-2012 by Larry Bugbee, Kent, WA
ALL RIGHTS RESERVED.
... | 32.196721 | 87 | 0.53806 |
4d3ae95ae00aaaa423668aeb768e22f7e546ebb4 | 271 | py | Python | moldesign/orbitals/__init__.py | Autodesk/molecular-design-toolkit | 5f45a47fea21d3603899a6366cb163024f0e2ec4 | [
"Apache-2.0"
] | 147 | 2016-07-15T18:53:55.000Z | 2022-01-30T04:36:39.000Z | moldesign/orbitals/__init__.py | cherishyli/molecular-design-toolkit | 5f45a47fea21d3603899a6366cb163024f0e2ec4 | [
"Apache-2.0"
] | 151 | 2016-07-15T21:35:11.000Z | 2019-10-10T08:57:29.000Z | moldesign/orbitals/__init__.py | cherishyli/molecular-design-toolkit | 5f45a47fea21d3603899a6366cb163024f0e2ec4 | [
"Apache-2.0"
] | 33 | 2016-08-02T00:04:51.000Z | 2021-09-02T10:05:04.000Z | def toplevel(o):
__all__.append(o.__name__)
return o
__all__ = []
from .primitives import *
from .gaussians import *
from .orbitals import *
from .cartesian import *
from .spherical import *
from .atomic_basis_fn import *
from .basis import *
from .wfn import *
| 19.357143 | 30 | 0.723247 |
f1fb14f7c9e4a07a352d797989213fed3843d32f | 6,155 | py | Python | plugins/youtube/plugin.py | dkim286/Cardinal | 716d38fae5c992315e8087de74ad0db2947d0d48 | [
"MIT"
] | 96 | 2015-01-24T00:00:45.000Z | 2022-03-15T14:06:57.000Z | plugins/youtube/plugin.py | dkim286/Cardinal | 716d38fae5c992315e8087de74ad0db2947d0d48 | [
"MIT"
] | 166 | 2015-01-02T02:30:24.000Z | 2022-03-24T20:03:55.000Z | plugins/youtube/plugin.py | dkim286/Cardinal | 716d38fae5c992315e8087de74ad0db2947d0d48 | [
"MIT"
] | 63 | 2015-02-13T06:46:01.000Z | 2022-02-24T10:50:34.000Z | import datetime
import re
import logging
import requests
from twisted.internet import defer
from twisted.internet.threads import deferToThread
from cardinal.decorators import command, event, help
from cardinal.exceptions import EventRejectedMessage
VIDEO_URL_REGEX = re.compile(r'https?:\/\/(?:www\.)?youtube\..{2,4}\... | 29.7343 | 139 | 0.576767 |
cb7918fde0bdef8c015d146f90f22520513365af | 7,609 | py | Python | tests/test_datamine.py | KeiferC/extract-table | 71995693aace37ab9a3637b472d996d7b9e68207 | [
"MIT"
] | null | null | null | tests/test_datamine.py | KeiferC/extract-table | 71995693aace37ab9a3637b472d996d7b9e68207 | [
"MIT"
] | 1 | 2020-11-24T18:08:42.000Z | 2020-12-17T04:30:42.000Z | tests/test_datamine.py | KeiferC/extract-table | 71995693aace37ab9a3637b472d996d7b9e68207 | [
"MIT"
] | 1 | 2020-11-24T17:53:40.000Z | 2020-11-24T17:53:40.000Z | import os
import json
import subprocess
import pytest
import gdutils.datamine as dm
#########################################
# Regression Test Inputs #
#########################################
standards_path = './docs/source/src/examples/naming_convention.json'
gh_user = 'octocat'
gh_acct_type = ... | 36.581731 | 79 | 0.588251 |
124d913e75828aea3849266130bf05a56d039beb | 146,756 | py | Python | venv/local/lib/python2.7/dist-packages/scapy/layers/inet6.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/local/lib/python2.7/dist-packages/scapy/layers/inet6.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/local/lib/python2.7/dist-packages/scapy/layers/inet6.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
#############################################################################
## ##
## inet6.py --- IPv6 support for Scapy ##
## see http://natisbad.org/IPv6/ ... | 39.302625 | 156 | 0.541641 |
e48975c5bc90fc7e6b83deae5ccf55ae04d73f2d | 262 | py | Python | einkd/gui/components/__init__.py | trickeydan/einkd | ca5bbdde8c5a6ab31ffa6745b42cb69a19eb1090 | [
"MIT"
] | null | null | null | einkd/gui/components/__init__.py | trickeydan/einkd | ca5bbdde8c5a6ab31ffa6745b42cb69a19eb1090 | [
"MIT"
] | null | null | null | einkd/gui/components/__init__.py | trickeydan/einkd | ca5bbdde8c5a6ab31ffa6745b42cb69a19eb1090 | [
"MIT"
] | null | null | null | """Components in the GUI."""
from .component import Component
from .filled import FilledComponent
from .image import ImageComponent
from .text import TextComponent
__all__ = [
"Component",
"FilledComponent",
"ImageComponent",
"TextComponent",
]
| 20.153846 | 35 | 0.729008 |
292e90e0541ba067016ece7813c04bdc9c8507ad | 14,963 | py | Python | python_modules/dagster/dagster/utils/__init__.py | wingyplus/dagster | 1771b49f58c62141628da6a767516d3dcb9637d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/utils/__init__.py | wingyplus/dagster | 1771b49f58c62141628da6a767516d3dcb9637d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/utils/__init__.py | wingyplus/dagster | 1771b49f58c62141628da6a767516d3dcb9637d6 | [
"Apache-2.0"
] | null | null | null | import contextlib
import datetime
import errno
import functools
import inspect
import multiprocessing
import os
import re
import signal
import socket
import subprocess
import sys
import tempfile
import threading
from collections import namedtuple
from enum import Enum
from warnings import warn
import six
import yaml
f... | 29.629703 | 103 | 0.682818 |
0ff3c4c0e69651b300fbd198307e9b31a6f4b23f | 981 | py | Python | python/dynamic_graph/sot/torque_control/tests/test_chirp.py | jviereck/sot-torque-control | 90409a656e5b5be4dd4ff937724154579861c20f | [
"BSD-2-Clause"
] | null | null | null | python/dynamic_graph/sot/torque_control/tests/test_chirp.py | jviereck/sot-torque-control | 90409a656e5b5be4dd4ff937724154579861c20f | [
"BSD-2-Clause"
] | null | null | null | python/dynamic_graph/sot/torque_control/tests/test_chirp.py | jviereck/sot-torque-control | 90409a656e5b5be4dd4ff937724154579861c20f | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 28 16:54:01 2015
Test the expressions for the acceleration limits that guarantees the feasibility
of the position and velocity limits in the feature.
These expression have been derived using the viability theory.
@author: adelpret
"""
import numpy as np
from numpy.random ... | 21.326087 | 80 | 0.618756 |
38f175529ae3c623979e0a8341957f8393ce5412 | 992 | py | Python | generator/group.py | nikor1337/python_training | 675e0209ec50696fc294658bbcaa267752de79f0 | [
"Apache-2.0"
] | null | null | null | generator/group.py | nikor1337/python_training | 675e0209ec50696fc294658bbcaa267752de79f0 | [
"Apache-2.0"
] | null | null | null | generator/group.py | nikor1337/python_training | 675e0209ec50696fc294658bbcaa267752de79f0 | [
"Apache-2.0"
] | 1 | 2021-02-24T06:55:52.000Z | 2021-02-24T06:55:52.000Z | from model.group import Group
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "data/groups.json"
for o, a in opt... | 25.435897 | 111 | 0.660282 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.