hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1a3dfca9899d41fc6c20840f9dd98454e3c9c785 | 56,182 | py | Python | python3/lib/python3.6/site-packages/tensorflow/contrib/tensor_forest/hybrid/ops/gen_training_ops.py | TruongThuyLiem/keras2tensorflow | 726f2370160701081cb43fbd8b56154c10d7ad63 | [
"MIT"
] | 3 | 2020-10-12T15:47:01.000Z | 2022-01-14T19:51:26.000Z | python3/lib/python3.6/site-packages/tensorflow/contrib/tensor_forest/hybrid/ops/gen_training_ops.py | TruongThuyLiem/keras2tensorflow | 726f2370160701081cb43fbd8b56154c10d7ad63 | [
"MIT"
] | null | null | null | python3/lib/python3.6/site-packages/tensorflow/contrib/tensor_forest/hybrid/ops/gen_training_ops.py | TruongThuyLiem/keras2tensorflow | 726f2370160701081cb43fbd8b56154c10d7ad63 | [
"MIT"
] | 2 | 2020-08-03T13:02:06.000Z | 2020-11-04T03:15:44.000Z | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: training_ops.cc
"""
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
from... | 41.926866 | 2,108 | 0.686661 |
45f49feea94421df26fecaa8f3e58bd67a96701a | 13,461 | py | Python | sysroot/usr/lib/python2.7/unittest/loader.py | 219-design/sysroot_qt5.15.0_binaries_armv6zk_rpizero | c3ad917b65b970c451148391ef1c2483593702ed | [
"MIT"
] | null | null | null | sysroot/usr/lib/python2.7/unittest/loader.py | 219-design/sysroot_qt5.15.0_binaries_armv6zk_rpizero | c3ad917b65b970c451148391ef1c2483593702ed | [
"MIT"
] | null | null | null | sysroot/usr/lib/python2.7/unittest/loader.py | 219-design/sysroot_qt5.15.0_binaries_armv6zk_rpizero | c3ad917b65b970c451148391ef1c2483593702ed | [
"MIT"
] | null | null | null | """Loading unittests."""
import os
import re
import sys
import traceback
import types
from functools import cmp_to_key as _CmpToKey
from fnmatch import fnmatch
from . import case, suite
__unittest = True
# what about .pyc or .pyo (etc)
# we would need to avoid loading the same tests multiple times
# from '.py', '.... | 42.463722 | 94 | 0.614145 |
6eb50ddc6e994f23a2e66bb749221f52671bc108 | 164 | py | Python | program.py | felipejunio05/Dino_Google_RNA | f3e69f1e866354a9ae5b584681e06428cf7389ad | [
"CC0-1.0"
] | 1 | 2020-08-10T21:55:25.000Z | 2020-08-10T21:55:25.000Z | program.py | felipejunio05/Dino_Google_RNA | f3e69f1e866354a9ae5b584681e06428cf7389ad | [
"CC0-1.0"
] | null | null | null | program.py | felipejunio05/Dino_Google_RNA | f3e69f1e866354a9ae5b584681e06428cf7389ad | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: Felipe Junio da Rocha
# Date: 2020/04/13
if __name__ == "__main__":
from menu import Menu
main = Menu()
main.run()
| 14.909091 | 31 | 0.591463 |
2b2e4613f2298e42c03be4f15beaec204645b84e | 26,641 | py | Python | pytorch_lightning/trainer/connectors/logger_connector/result.py | Aiden-Jeon/pytorch-lightning | 963c26764682fa4cf64c93c5a7572ae0040e9c32 | [
"Apache-2.0"
] | 2 | 2021-08-16T07:25:52.000Z | 2022-03-05T13:09:38.000Z | pytorch_lightning/trainer/connectors/logger_connector/result.py | Aiden-Jeon/pytorch-lightning | 963c26764682fa4cf64c93c5a7572ae0040e9c32 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/connectors/logger_connector/result.py | Aiden-Jeon/pytorch-lightning | 963c26764682fa4cf64c93c5a7572ae0040e9c32 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 38.666183 | 118 | 0.627754 |
f62ac7d0f1caf2963978fab43765ec22478bc37c | 1,271 | py | Python | rundaemon.py | ssaid/fiscalberry | 6b70774c6c7792d9f5aecf38c8bdfbf92beda372 | [
"Apache-2.0"
] | 1 | 2018-02-27T19:26:23.000Z | 2018-02-27T19:26:23.000Z | rundaemon.py | ssaid/fiscalberry | 6b70774c6c7792d9f5aecf38c8bdfbf92beda372 | [
"Apache-2.0"
] | null | null | null | rundaemon.py | ssaid/fiscalberry | 6b70774c6c7792d9f5aecf38c8bdfbf92beda372 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2.7
import os
import argparse
import daemon
import sys
import logging
from daemon import pidfile
from FiscalberryApp import FiscalberryApp
def do_something():
### This does the "work" of the daemon
fbserver = FiscalberryApp()
fbserver.start()
def start_daemon(pidf, logf):
### Th... | 26.479167 | 79 | 0.696302 |
6a0b9d8cae73d921501998751d2452fe66508e5b | 4,428 | py | Python | pytype/tests/test_abc2.py | kianmeng/pytype | b64248d6f8d9553da5b2f258fd6ad31d18b001d4 | [
"Apache-2.0"
] | 1 | 2021-12-31T08:46:43.000Z | 2021-12-31T08:46:43.000Z | pytype/tests/test_abc2.py | kianmeng/pytype | b64248d6f8d9553da5b2f258fd6ad31d18b001d4 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_abc2.py | kianmeng/pytype | b64248d6f8d9553da5b2f258fd6ad31d18b001d4 | [
"Apache-2.0"
] | null | null | null | """Tests for @abc.abstractmethod in abc_overlay.py."""
from pytype import file_utils
from pytype.tests import test_base
class AbstractMethodTests(test_base.BaseTest):
"""Tests for @abc.abstractmethod."""
def test_no_skip_call(self):
self.Check("""
import abc
class Example(metaclass=abc.ABCMeta):... | 26.047059 | 79 | 0.576558 |
e587d41ea0bb2dcbe086b9613043dc6482f15c18 | 103 | py | Python | xoto3/__about__.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 16 | 2020-05-23T15:23:38.000Z | 2022-03-18T19:28:37.000Z | xoto3/__about__.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 9 | 2020-08-19T23:08:36.000Z | 2021-10-06T17:16:35.000Z | xoto3/__about__.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 2 | 2020-12-12T08:23:53.000Z | 2021-09-03T20:25:54.000Z | """xoto3"""
__version__ = "1.16.0"
__author__ = "Peter Gaultney"
__author_email__ = "pgaultney@xoi.io"
| 20.6 | 37 | 0.708738 |
0b48b63d1b708bfaef7f087a4560e22978876e99 | 85 | py | Python | eskar/__init__.py | JasonGlazer/Eskar | bcb0acc8adf09821108cdd8af30395cc22fadf9f | [
"BSD-3-Clause"
] | null | null | null | eskar/__init__.py | JasonGlazer/Eskar | bcb0acc8adf09821108cdd8af30395cc22fadf9f | [
"BSD-3-Clause"
] | null | null | null | eskar/__init__.py | JasonGlazer/Eskar | bcb0acc8adf09821108cdd8af30395cc22fadf9f | [
"BSD-3-Clause"
] | null | null | null | NAME = "Eskar"
VERSION = "0.01"
DOCS_URL = "https://eskar.readthedocs.io/en/latest/"
| 21.25 | 52 | 0.682353 |
5f776feef1ff538884691fa58003319f68b9b534 | 6,804 | py | Python | wagtail/wagtailadmin/utils.py | yohanlebret/wagtail | 03c623b467ef8ed3849872273ebad13d48f755ac | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailadmin/utils.py | yohanlebret/wagtail | 03c623b467ef8ed3849872273ebad13d48f755ac | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailadmin/utils.py | yohanlebret/wagtail | 03c623b467ef8ed3849872273ebad13d48f755ac | [
"BSD-3-Clause"
] | 1 | 2019-03-05T15:37:22.000Z | 2019-03-05T15:37:22.000Z | from functools import wraps
from django.template.loader import render_to_string
from django.core.mail import send_mail as django_send_mail
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db.models import Q
from django.shortcuts import redirect
from django.utils.translation i... | 33.029126 | 107 | 0.672399 |
b14b7fcc39013c07b5a35f2e6e0efaa2ab96c9fe | 5,082 | py | Python | sdk/python/pulumi_azure_nextgen/devtestlab/v20160515/list_virtual_machine_applicable_schedules.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/devtestlab/v20160515/list_virtual_machine_applicable_schedules.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/devtestlab/v20160515/list_virtual_machine_applicable_schedules.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 37.925373 | 187 | 0.658205 |
d16e532b024936ee643c1ee3e1b48e017b0e20f8 | 388 | py | Python | Main.py | ShivaTheGodOfDestruction/darkinsta | 981bcf51bf41e8f8bbb315961e2eca48d5fdb021 | [
"Apache-2.0"
] | 2 | 2021-04-18T17:48:39.000Z | 2021-06-23T21:51:33.000Z | Main.py | ShivaTheGodOfDestruction/darkinsta | 981bcf51bf41e8f8bbb315961e2eca48d5fdb021 | [
"Apache-2.0"
] | null | null | null | Main.py | ShivaTheGodOfDestruction/darkinsta | 981bcf51bf41e8f8bbb315961e2eca48d5fdb021 | [
"Apache-2.0"
] | 1 | 2021-11-26T08:40:44.000Z | 2021-11-26T08:40:44.000Z | #!/bin/bash
clear
line="\e[1;31m[*]\e[0m"
echo -e "$line Starting Install ..."
echo -e "$line This May Take Some Time"
chmod 777 main.py
command -v python > /dev/null 2>&1 || apt install -y python
command -v python3 > /dev/null 2>&1 || apt install -y python
pip3 install -r modules
python3 -m pip install -r modules
ech... | 27.714286 | 60 | 0.68299 |
7beb00121198cfffc753eed3d60eb191cad505bc | 2,488 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20181101/get_virtual_network_gateway_learned_routes.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20181101/get_virtual_network_gateway_learned_routes.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20181101/get_virtual_network_gateway_learned_routes.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # 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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 37.134328 | 184 | 0.712219 |
57859d0c647c83a9aae4b19f0058b696a0acaa34 | 1,074 | py | Python | packages/fetchai/skills/confirmation_aw3/behaviours.py | bryanchriswhite/agents-aea | d3f177a963eb855d9528555167255bf2b478f4ba | [
"Apache-2.0"
] | 126 | 2019-09-07T09:32:44.000Z | 2022-03-29T14:28:41.000Z | packages/fetchai/skills/confirmation_aw3/behaviours.py | salman6049/agents-aea | d3f177a963eb855d9528555167255bf2b478f4ba | [
"Apache-2.0"
] | 1,814 | 2019-08-24T10:08:07.000Z | 2022-03-31T14:28:36.000Z | packages/fetchai/skills/confirmation_aw3/behaviours.py | salman6049/agents-aea | d3f177a963eb855d9528555167255bf2b478f4ba | [
"Apache-2.0"
] | 46 | 2019-09-03T22:13:58.000Z | 2022-03-22T01:25:16.000Z | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | 35.8 | 80 | 0.638734 |
5e0f6b0f3b9ea255d458eb04d3cc8bb5828c5990 | 1,097 | py | Python | app/main.py | nyuvis/research-project-template | 3f84a6c492b72de9385afbe9080a316ab0ce99d6 | [
"MIT"
] | null | null | null | app/main.py | nyuvis/research-project-template | 3f84a6c492b72de9385afbe9080a316ab0ce99d6 | [
"MIT"
] | null | null | null | app/main.py | nyuvis/research-project-template | 3f84a6c492b72de9385afbe9080a316ab0ce99d6 | [
"MIT"
] | null | null | null | import os
import random
from flask import Flask, send_file, jsonify
app = Flask(__name__)
@app.route("/data")
def data():
names = ['Annie', 'Bob', 'Cooper', 'Dougie', 'Laura']
data = [{'name': name, 'score': random.randint(0, 100)} for name in names]
return jsonify(data)
@app.route("/")
def main():
... | 28.128205 | 78 | 0.661805 |
efa35e696a0d6487fd59b2ab62544c19d97e794d | 409 | py | Python | app/notify_client/letter_jobs_client.py | karlchillmaid/notifications-admin | 9ef6da4ef9e2fa97b7debb4b573cb035a5cb8880 | [
"MIT"
] | null | null | null | app/notify_client/letter_jobs_client.py | karlchillmaid/notifications-admin | 9ef6da4ef9e2fa97b7debb4b573cb035a5cb8880 | [
"MIT"
] | null | null | null | app/notify_client/letter_jobs_client.py | karlchillmaid/notifications-admin | 9ef6da4ef9e2fa97b7debb4b573cb035a5cb8880 | [
"MIT"
] | null | null | null | from app.notify_client import NotifyAdminAPIClient
class LetterJobsClient(NotifyAdminAPIClient):
def __init__(self):
super().__init__("a" * 73, "b")
def get_letter_jobs(self):
return self.get(url='/letter-jobs')['data']
def send_letter_jobs(self, job_ids):
return self.post(
... | 24.058824 | 51 | 0.621027 |
77b89ac5567a33f2f26d0f48c2022f5fda36788c | 7,905 | py | Python | Resources/Lokesh/Lab2/try2.py | rishitsaiya/CS312-AI-Lab | 30489e07a71f04b47d38139937a7229fbc4c6185 | [
"MIT"
] | 2 | 2021-12-24T16:43:43.000Z | 2022-02-01T03:49:55.000Z | Resources/Lokesh/Lab2/try2.py | rishitsaiya/CS312-AI-Lab | 30489e07a71f04b47d38139937a7229fbc4c6185 | [
"MIT"
] | null | null | null | Resources/Lokesh/Lab2/try2.py | rishitsaiya/CS312-AI-Lab | 30489e07a71f04b47d38139937a7229fbc4c6185 | [
"MIT"
] | 6 | 2021-04-23T08:37:14.000Z | 2022-02-27T15:21:54.000Z | import copy
import time
class state:
h_value = 0
poles = [[],[],[]]
parent = 0
ten = 0
def __eq__(self,other):
return self.poles == other.poles
def disp(self):
i = 0
for pole in self.poles:
print(i," --> ",pole)
i = i + 1
print()
start = ... | 25.336538 | 127 | 0.482353 |
6ce8bfd3d85619be6d0d4f0058d6b401f7469031 | 33 | py | Python | lib/take2/lib/__init__.py | zacharyfrederick/deep_q_gaf | 6b712b17a6c89c1cba0d22e18fa336369c521d4e | [
"MIT"
] | null | null | null | lib/take2/lib/__init__.py | zacharyfrederick/deep_q_gaf | 6b712b17a6c89c1cba0d22e18fa336369c521d4e | [
"MIT"
] | null | null | null | lib/take2/lib/__init__.py | zacharyfrederick/deep_q_gaf | 6b712b17a6c89c1cba0d22e18fa336369c521d4e | [
"MIT"
] | null | null | null | from .env_config import EnvConfig | 33 | 33 | 0.878788 |
ce80c2139ca0ff31330cef63180771a9cd8c8bfd | 310 | py | Python | service/__init__.py | Zhou-Yicheng/SUSTech-CS307-Project2-Python | 3885d85db28d74547bca0dec9243575bbc1d08cb | [
"MIT"
] | 2 | 2021-05-18T14:02:37.000Z | 2021-05-30T02:55:28.000Z | service/__init__.py | Zhou-Yicheng/SUSTech-CS307-Project2-Python | 3885d85db28d74547bca0dec9243575bbc1d08cb | [
"MIT"
] | null | null | null | service/__init__.py | Zhou-Yicheng/SUSTech-CS307-Project2-Python | 3885d85db28d74547bca0dec9243575bbc1d08cb | [
"MIT"
] | 3 | 2021-06-07T15:36:53.000Z | 2021-07-03T02:37:19.000Z | from .course_service import CourseService
from .department_service import DepartmentService
from .instructor_service import InstructorService
from .major_service import MajorService
from .semester_service import SemesterService
from .student_service import StudentService
from .user_service import UserService
| 38.75 | 49 | 0.887097 |
271cf4aababbfe1a65258960fc8f44a465f1ca7e | 9,156 | py | Python | csrank/discretechoice/multinomial_logit_model.py | kiudee/cs-ranking | 47cf648fa286c37b9214bbad1926004d4d7d9796 | [
"Apache-2.0"
] | 65 | 2018-02-12T13:18:13.000Z | 2021-12-18T12:01:51.000Z | csrank/discretechoice/multinomial_logit_model.py | kiudee/cs-ranking | 47cf648fa286c37b9214bbad1926004d4d7d9796 | [
"Apache-2.0"
] | 189 | 2018-02-13T10:11:55.000Z | 2022-03-12T16:36:23.000Z | csrank/discretechoice/multinomial_logit_model.py | kiudee/cs-ranking | 47cf648fa286c37b9214bbad1926004d4d7d9796 | [
"Apache-2.0"
] | 19 | 2018-03-08T15:39:31.000Z | 2020-11-18T12:46:36.000Z | import logging
import numpy as np
from csrank.learner import Learner
import csrank.theano_util as ttu
from csrank.util import print_dictionary
from .discrete_choice import DiscreteObjectChooser
from .likelihoods import create_weight_dictionary
from .likelihoods import fit_pymc3_model
from .likelihoods import likeliho... | 39.636364 | 136 | 0.591306 |
97b7b1069eb0dcd52282fe86f758546a10110076 | 9,970 | py | Python | exporter/applications/forms/goods.py | code-review-doctor/lite-frontend-1 | cb3b885bb389ea33ef003c916bea7b03a36d86bb | [
"MIT"
] | null | null | null | exporter/applications/forms/goods.py | code-review-doctor/lite-frontend-1 | cb3b885bb389ea33ef003c916bea7b03a36d86bb | [
"MIT"
] | null | null | null | exporter/applications/forms/goods.py | code-review-doctor/lite-frontend-1 | cb3b885bb389ea33ef003c916bea7b03a36d86bb | [
"MIT"
] | null | null | null | from django.urls import reverse_lazy
from exporter.core import constants
from exporter.core.services import get_units, get_item_types
from exporter.goods.helpers import good_summary
from exporter.goods.forms import (
firearms_number_of_items,
identification_markings_form,
firearms_capture_serial_numbers,
... | 40.528455 | 119 | 0.578736 |
d431dd45b6d5436d804a907e773d70fbb0f16f37 | 1,318 | py | Python | microbot/message.py | minelminel/microbot | 71517217b6deccc61efe408e91d5545838d910c8 | [
"MIT"
] | null | null | null | microbot/message.py | minelminel/microbot | 71517217b6deccc61efe408e91d5545838d910c8 | [
"MIT"
] | null | null | null | microbot/message.py | minelminel/microbot | 71517217b6deccc61efe408e91d5545838d910c8 | [
"MIT"
] | null | null | null | """
message.py
"""
import logging, uuid, time
from types import SimpleNamespace
import marshmallow as ma
from microbot.util import make_uuid, make_time
log = logging.getLogger(__name__)
class Message(SimpleNamespace):
pass
class MessageSchema(ma.Schema):
# what is the purpose of this message
# ex. "in... | 22.724138 | 73 | 0.64871 |
0420eff232a9bc172d5b25317ce48d666846daad | 2,448 | py | Python | src/lib/dbmgr.py | Project-Prismatica/Prism-Shell | 006d04fdabbe51c4a3fd642e05ba276251f1bba4 | [
"MIT"
] | null | null | null | src/lib/dbmgr.py | Project-Prismatica/Prism-Shell | 006d04fdabbe51c4a3fd642e05ba276251f1bba4 | [
"MIT"
] | null | null | null | src/lib/dbmgr.py | Project-Prismatica/Prism-Shell | 006d04fdabbe51c4a3fd642e05ba276251f1bba4 | [
"MIT"
] | 1 | 2018-02-22T02:18:48.000Z | 2018-02-22T02:18:48.000Z | import sys
import os
import sqlite3
sys.path.append("../")
class dbmgr:
def __init__( self):
self.conn = sqlite3.connect('/home/adhd/Desktop/Cerberus/cerberus.db', timeout=1) #You like the dick, you stupid variable python path piece of crap... !
self.conn.execute('pragma foreign_keys = on')
... | 40.131148 | 198 | 0.620507 |
6379a6d8a8b5128f31a199def32f5a7a325ad94e | 7,056 | py | Python | src/pyshowdown/message.py | ScottehMax/pyshowdown | 34e5809b55ce4032a64c3e07270d13d1a32f83ed | [
"MIT"
] | null | null | null | src/pyshowdown/message.py | ScottehMax/pyshowdown | 34e5809b55ce4032a64c3e07270d13d1a32f83ed | [
"MIT"
] | null | null | null | src/pyshowdown/message.py | ScottehMax/pyshowdown | 34e5809b55ce4032a64c3e07270d13d1a32f83ed | [
"MIT"
] | null | null | null | import json
from typing import Optional, List, Dict
from pyshowdown.user import User
class Message:
def __init__(self, room: str, message_str: str):
"""Initialize a Message object.
Args:
room (str): The room the message was sent to.
message_str (str): The raw message.
... | 28.682927 | 77 | 0.492347 |
7ba4125f80522fe3f6d4076f3c713e960cea1d68 | 213 | py | Python | venv/Lib/site-packages/hashid_field/conf.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | venv/Lib/site-packages/hashid_field/conf.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | venv/Lib/site-packages/hashid_field/conf.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | from django.conf import settings
setattr(settings, 'HASHID_FIELD_SALT', getattr(settings, 'HASHID_FIELD_SALT', ""))
setattr(settings, 'HASHID_FIELD_ALLOW_INT', getattr(settings, 'HASHID_FIELD_ALLOW_INT', True))
| 35.5 | 94 | 0.798122 |
952571f17e16af4cbad8f35bf8cc3a9b4e9ca2eb | 4,762 | py | Python | src/gradient_accumulation.py | brentbiseda/W207_Final_NIH_Chest_X_Rays_Classification | e916f8aa4613b80277aa6486b8342d017bad55f8 | [
"MIT"
] | 3 | 2020-03-16T05:51:16.000Z | 2021-03-05T10:01:48.000Z | src/gradient_accumulation.py | brentbiseda/W207_Final_NIH_Chest_X_Rays_Classification | e916f8aa4613b80277aa6486b8342d017bad55f8 | [
"MIT"
] | 1 | 2021-04-18T16:29:02.000Z | 2021-04-18T16:29:02.000Z | src/gradient_accumulation.py | brentbiseda/W207_Final_NIH_Chest_X_Rays_Classification | e916f8aa4613b80277aa6486b8342d017bad55f8 | [
"MIT"
] | 1 | 2020-03-17T20:22:45.000Z | 2020-03-17T20:22:45.000Z | # Gradient Accumulation Borrowed from following location:
# https://stackoverflow.com/questions/55268762/how-to-accumulate-gradients-for-large-batch-sizes-in-keras
import keras.backend as K
from keras.legacy import interfaces
from keras.optimizers import Optimizer
import tensorflow as tf
class AdamAccumulate(Op... | 45.788462 | 134 | 0.586518 |
8529ea74bd89b7cb5b009a5aba3260b8cd2a6e36 | 811 | py | Python | test/polymullvl2.py | virtualsecureplatform/pyFHE | 95f9df706ac2bccabfca84077bab2eb8a4b66ffa | [
"Apache-2.0"
] | 11 | 2019-11-13T07:11:13.000Z | 2022-03-20T01:37:02.000Z | test/polymullvl2.py | virtualsecureplatform/pyFHE | 95f9df706ac2bccabfca84077bab2eb8a4b66ffa | [
"Apache-2.0"
] | 1 | 2019-09-21T10:17:38.000Z | 2019-10-14T02:15:36.000Z | test/polymullvl2.py | virtualsecureplatform/pyFHE | 95f9df706ac2bccabfca84077bab2eb8a4b66ffa | [
"Apache-2.0"
] | 2 | 2020-01-03T11:09:59.000Z | 2021-04-12T13:19:18.000Z | from pyFHE.mulfft import PolyMullvl2, TwistGen,TwistFFT,TwistIFFT
from pyFHE.utils import dtot64
from pyFHE.key import SecretKey
import numpy as np
N = 2048
Bg = 2**9
twist = TwistGen(N)
for i in range(10000):
a = dtot64(np.random.random(N)) * 2 ** -64
b = np.int64(np.random.randint(-Bg // 2, Bg // 2, N)) # c... | 35.26087 | 90 | 0.569667 |
e4d4e94cd6adf15092bc2dd81bf9656dbcb4e093 | 1,042 | py | Python | src/Python/601-700/669.TrimBST.py | Peefy/PeefyLeetCode | 92156e4b48ba19e3f02e4286b9f733e9769a1dee | [
"Apache-2.0"
] | 2 | 2018-05-03T07:50:03.000Z | 2018-06-17T04:32:13.000Z | src/Python/601-700/669.TrimBST.py | Peefy/PeefyLeetCode | 92156e4b48ba19e3f02e4286b9f733e9769a1dee | [
"Apache-2.0"
] | null | null | null | src/Python/601-700/669.TrimBST.py | Peefy/PeefyLeetCode | 92156e4b48ba19e3f02e4286b9f733e9769a1dee | [
"Apache-2.0"
] | 3 | 2018-11-09T14:18:11.000Z | 2021-11-17T15:23:52.000Z |
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def trimBST(self, root, L, R):
"""
:type root: TreeNode
:type L: int
:type R: int
:rtype: TreeNode
"""
if root == None:
... | 25.414634 | 55 | 0.538388 |
c8763d846bd566ccfe2d4c40019375151d5981c3 | 2,891 | py | Python | Lib/site-packages/PySide/examples/itemviews/fetchmore.py | heylenz/python27 | bee49fa9d65b8ab7d591146a5b6cd47aeb41d940 | [
"bzip2-1.0.6",
"MIT"
] | 32 | 2015-11-06T02:59:41.000Z | 2021-02-12T02:44:42.000Z | Lib/site-packages/PySide/examples/itemviews/fetchmore.py | heylenz/python27 | bee49fa9d65b8ab7d591146a5b6cd47aeb41d940 | [
"bzip2-1.0.6",
"MIT"
] | 56 | 2020-01-15T15:44:40.000Z | 2021-11-15T17:50:24.000Z | Lib/site-packages/PySide/examples/itemviews/fetchmore.py | heylenz/python27 | bee49fa9d65b8ab7d591146a5b6cd47aeb41d940 | [
"bzip2-1.0.6",
"MIT"
] | 4 | 2016-02-01T09:15:05.000Z | 2020-04-30T03:41:04.000Z | #!/usr/bin/python
# Fetch More Example
# Ported to PyQt4 by Darryl Wallace, 2009 - wallacdj@gmail.com
from PySide import QtCore, QtGui
class FileListModel(QtCore.QAbstractListModel):
numberPopulated = QtCore.Signal(int)
def __init__(self, parent=None):
super(FileListModel, self).__init__(parent)
... | 26.768519 | 113 | 0.634037 |
1e1928b89290785a12f720cbd735654b0b316dc3 | 4,990 | py | Python | crawler/scrapy_crawler/scrapy_crawler/spiders/bitcoinmagazine_spider.py | 43ndr1k/Mappinng-Cryptocurrencies-with-News | 59ee968192c477468668e1f8953cde59547ce070 | [
"Apache-2.0"
] | null | null | null | crawler/scrapy_crawler/scrapy_crawler/spiders/bitcoinmagazine_spider.py | 43ndr1k/Mappinng-Cryptocurrencies-with-News | 59ee968192c477468668e1f8953cde59547ce070 | [
"Apache-2.0"
] | null | null | null | crawler/scrapy_crawler/scrapy_crawler/spiders/bitcoinmagazine_spider.py | 43ndr1k/Mappinng-Cryptocurrencies-with-News | 59ee968192c477468668e1f8953cde59547ce070 | [
"Apache-2.0"
] | null | null | null | # __filename__: bitcoinmagazine_spider.py
#
# __description__: Spider for bitcoinmagazine.com.
#
# __remark__: To run spider activate venv with scrapy, cd to folder scrapy_crawler and
# scrapy crawl coindesk (-a t=option)
#
# __todos__:
#
# Created by Tobias Wenzel in October/November 2017
from datetime import dateti... | 36.962963 | 129 | 0.539078 |
041f3d77d9dfcef245dc59feacc04001bf006676 | 535 | py | Python | machine_learning/server.py | jonassebaoni/webstat | 15022b2a571ecb363f52dfd83bd5f36c961295f5 | [
"MIT"
] | null | null | null | machine_learning/server.py | jonassebaoni/webstat | 15022b2a571ecb363f52dfd83bd5f36c961295f5 | [
"MIT"
] | null | null | null | machine_learning/server.py | jonassebaoni/webstat | 15022b2a571ecb363f52dfd83bd5f36c961295f5 | [
"MIT"
] | null | null | null | from flask import Flask, request, Response
from flask_cors import CORS
from sales_predictor import SalesPredictor
app = Flask(__name__)
CORS(app)
@app.route('/api/predict/sales', methods=['GET'])
def predict_sales():
day = request.args.get('day')
weather = request.args.get('weather')
predictor = SalesP... | 20.576923 | 58 | 0.697196 |
1bc985708c5542cc2f5320185580cebd3a3f9e79 | 852 | py | Python | client.py | sjs1178/jandichatbot | bdb20e6f671a2a133c8ad7ea73caefb3c8818fd8 | [
"MIT"
] | 3 | 2018-01-08T12:21:47.000Z | 2019-03-15T13:26:55.000Z | client.py | sjs1178/jandichatbot | bdb20e6f671a2a133c8ad7ea73caefb3c8818fd8 | [
"MIT"
] | null | null | null | client.py | sjs1178/jandichatbot | bdb20e6f671a2a133c8ad7ea73caefb3c8818fd8 | [
"MIT"
] | 2 | 2018-04-11T04:54:37.000Z | 2020-03-30T11:18:17.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Client to send inputs for predictions."""
import requests
def get_predictions(X_input):
"""Get predictions from a rest backend for your input."""
print("Requesting prediction for XOR with {0}".format(X_input))
r = requests.post("http://localhost:7171/predi... | 32.769231 | 105 | 0.653756 |
07aef726444e17c0ddf2317f67e6ae567182f66e | 1,650 | py | Python | analysis.py | jmcguinness11/OddScraper | cee2688d401501351c05a96766f80abecdad636e | [
"MIT"
] | null | null | null | analysis.py | jmcguinness11/OddScraper | cee2688d401501351c05a96766f80abecdad636e | [
"MIT"
] | null | null | null | analysis.py | jmcguinness11/OddScraper | cee2688d401501351c05a96766f80abecdad636e | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
from itertools import tee
import pandas as pd
import numpy as np
# read in cbb data
res_df = pd.read_csv('ncb_16_17.csv')
it = res_df.iterrows()
games = []
for team_tup, opp_tup in zip(it, it):
team = team_tup[1]
opp = opp_tup[1]
#skip games with no moneyline info
try:
tml = int(team.ML... | 24.264706 | 82 | 0.709697 |
29dd6fd0dca08aeb845fc7c16fd78c45477700cc | 499 | py | Python | server/test.py | SentyFunBall/valour-vapp | ec2c029f206fcb92b59b974cf1335fbfffa3ef9a | [
"MIT"
] | 1 | 2021-01-16T18:01:51.000Z | 2021-01-16T18:01:51.000Z | server/test.py | SentyFunBall/valour-vapp | ec2c029f206fcb92b59b974cf1335fbfffa3ef9a | [
"MIT"
] | 17 | 2021-01-16T08:40:53.000Z | 2021-05-08T19:23:54.000Z | server/test.py | SentyFunBall/valour-vapp | ec2c029f206fcb92b59b974cf1335fbfffa3ef9a | [
"MIT"
] | 3 | 2021-02-01T01:43:38.000Z | 2021-02-02T12:31:48.000Z | import requests
Base = 'http://127.0.0.1:5000/' # use this for the 'base_url' test server, later we will use the valour link
def get(base_url, final):
response = requests.get(base_url + final)
return response.json().keys(), response.json().values()
def post_something(base_url, final, something_key, someth... | 33.266667 | 109 | 0.713427 |
804aab6cea86a41ecb8ba3c8b61a9f53941d495e | 712 | py | Python | IB_Api/ibapi/commission_report.py | candypantsnola/QTS_Research | d62ecb1ecc5d5429f58b9f566cdd052e491bae28 | [
"MIT"
] | 20 | 2017-03-05T22:15:29.000Z | 2022-02-18T11:45:50.000Z | IB_Api/ibapi/commission_report.py | candypantsnola/QTS_Research | d62ecb1ecc5d5429f58b9f566cdd052e491bae28 | [
"MIT"
] | null | null | null | IB_Api/ibapi/commission_report.py | candypantsnola/QTS_Research | d62ecb1ecc5d5429f58b9f566cdd052e491bae28 | [
"MIT"
] | 14 | 2017-03-05T22:49:04.000Z | 2022-01-02T21:34:19.000Z | """
Copyright (C) 2016 Interactive Brokers LLC. All rights reserved. This code is
subject to the terms and conditions of the IB API Non-Commercial License or the
IB API Commercial License, as applicable.
"""
from ibapi.object_implem import Object
class CommissionReport(Object):
def __init__(self):
s... | 27.384615 | 79 | 0.633427 |
3f6e46546f92821b9f52bedd3e4f4e76c078dbb8 | 16,229 | py | Python | tests/integration/popular_repos/popular_repos.py | adamyi/rules_go | 72082b388452f847fcace6f1053a5ffadfc91e0c | [
"Apache-2.0"
] | 2 | 2020-10-04T12:09:41.000Z | 2020-10-04T23:04:40.000Z | tests/integration/popular_repos/popular_repos.py | adamyi/rules_go | 72082b388452f847fcace6f1053a5ffadfc91e0c | [
"Apache-2.0"
] | null | null | null | tests/integration/popular_repos/popular_repos.py | adamyi/rules_go | 72082b388452f847fcace6f1053a5ffadfc91e0c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 The Bazel 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 req... | 51.520635 | 127 | 0.663011 |
4abf3816a354842401edd6ce3a6eb0a3685288cb | 9,906 | py | Python | eval_ap.py | thesuperorange/task-conditioned | dd700bbed6806d166b8ede6142a2129bc69fdef6 | [
"MIT"
] | 21 | 2020-08-18T11:01:59.000Z | 2022-03-12T22:49:26.000Z | eval_ap.py | thesuperorange/task-conditioned | dd700bbed6806d166b8ede6142a2129bc69fdef6 | [
"MIT"
] | 4 | 2021-01-02T04:06:29.000Z | 2022-01-16T02:08:06.000Z | eval_ap.py | thesuperorange/task-conditioned | dd700bbed6806d166b8ede6142a2129bc69fdef6 | [
"MIT"
] | 9 | 2020-10-02T07:19:19.000Z | 2022-03-25T10:12:15.000Z | # --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Bharath Hariharan
# --------------------------------------------------------
import xml.etree.ElementTree as ET
import os,sys
# import cPickle
import _pickle as cPickle
# i... | 32.910299 | 98 | 0.545326 |
112a2412fbd2193893524a57f5cf6d5d67897f7b | 2,408 | py | Python | pydatamocker/mock_table.py | msoukharev/pydatamocker | 18edb15c464db696980ec9991c19b723e80e255f | [
"MIT"
] | null | null | null | pydatamocker/mock_table.py | msoukharev/pydatamocker | 18edb15c464db696980ec9991c19b723e80e255f | [
"MIT"
] | null | null | null | pydatamocker/mock_table.py | msoukharev/pydatamocker | 18edb15c464db696980ec9991c19b723e80e255f | [
"MIT"
] | null | null | null | from .util.data import load_data, write_dataframe, load_json, write_json
from .builder import build_dataframe
from .util.collections import dedup_list, list_diff
def _config_column_order(specified, fields_dict):
if not specified or len(specified) < 1:
return fields_dict
spec_dedup = dedup_list(specifi... | 30.481013 | 100 | 0.619601 |
7f08fdac0f9f9af513f75d7e322b515bd0bcc55b | 6,262 | py | Python | ogs5py/reader/vtkhelper.py | MuellerSeb/ogs5py | 752e7bd2298fbd476406d168f6b7d1a85863dccd | [
"MIT"
] | 3 | 2018-05-27T15:39:07.000Z | 2018-10-29T17:02:11.000Z | ogs5py/reader/vtkhelper.py | MuellerSeb/ogs5py | 752e7bd2298fbd476406d168f6b7d1a85863dccd | [
"MIT"
] | 1 | 2018-11-12T11:32:12.000Z | 2018-11-12T13:07:48.000Z | ogs5py/reader/vtkhelper.py | MuellerSeb/ogs5py | 752e7bd2298fbd476406d168f6b7d1a85863dccd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Helper functions for the vtk readers in ogs5py."""
import numpy as np
from vtk import (
vtkPolyDataReader,
vtkRectilinearGridReader,
vtkStructuredGridReader,
vtkStructuredPointsReader,
vtkUnstructuredGridReader,
vtkXMLPolyDataReader,
vtkXMLRectilinearGridReader,
... | 34.596685 | 79 | 0.59901 |
4719c02f0b6064d828d19073dd3db0cfb938fbf7 | 2,327 | py | Python | insights/parsers/tests/test_corosync.py | smalleni/insights-core | 3961d400f032b2b1ed66665813ebe5220f27c62d | [
"Apache-2.0"
] | null | null | null | insights/parsers/tests/test_corosync.py | smalleni/insights-core | 3961d400f032b2b1ed66665813ebe5220f27c62d | [
"Apache-2.0"
] | null | null | null | insights/parsers/tests/test_corosync.py | smalleni/insights-core | 3961d400f032b2b1ed66665813ebe5220f27c62d | [
"Apache-2.0"
] | null | null | null | import doctest
import pytest
from insights.configtree import first, last
from insights.parsers import corosync, SkipException
from insights.tests import context_wrap
corosync_content = """
# Corosync init script configuration file
# COROSYNC_INIT_TIMEOUT specifies number of seconds to wait for corosync
# initializati... | 23.505051 | 83 | 0.694886 |
aec18b4bb796a9205a2f87bc96274c34ad2daa98 | 1,171 | py | Python | g-code-testing/g_code_parsing/g_code_functionality_defs/smoothie/set_current_g_code_functionality_def.py | Opentrons/protocol_framework | ebbd6b2fe984edd6ecfcbf1dbe040db7f7356b9f | [
"Apache-2.0"
] | null | null | null | g-code-testing/g_code_parsing/g_code_functionality_defs/smoothie/set_current_g_code_functionality_def.py | Opentrons/protocol_framework | ebbd6b2fe984edd6ecfcbf1dbe040db7f7356b9f | [
"Apache-2.0"
] | null | null | null | g-code-testing/g_code_parsing/g_code_functionality_defs/smoothie/set_current_g_code_functionality_def.py | Opentrons/protocol_framework | ebbd6b2fe984edd6ecfcbf1dbe040db7f7356b9f | [
"Apache-2.0"
] | null | null | null | from typing import Dict
from string import Template
from enum import Enum
from g_code_parsing.g_code_functionality_defs.g_code_functionality_def_base import (
GCodeFunctionalityDefBase,
)
class SetCurrentGCodeFunctionalityDef(GCodeFunctionalityDefBase):
# Using this list to output string in specific order
... | 36.59375 | 84 | 0.65585 |
0a12b50dd4c38aa7562e873005ed46a05bab8e59 | 1,135 | py | Python | wxVTK/src/DynamicDialog.py | darrenleeweber/pyBEM | bc4b96ec93cd202b7a80f2803011f29582bb5393 | [
"Apache-2.0"
] | null | null | null | wxVTK/src/DynamicDialog.py | darrenleeweber/pyBEM | bc4b96ec93cd202b7a80f2803011f29582bb5393 | [
"Apache-2.0"
] | null | null | null | wxVTK/src/DynamicDialog.py | darrenleeweber/pyBEM | bc4b96ec93cd202b7a80f2803011f29582bb5393 | [
"Apache-2.0"
] | null | null | null | import wx
class DynamicDialog(wx.Dialog):
def __init__(self, mediator, parent, ID, title, size=wx.DefaultSize, pos=wx.DefaultPosition,
style=wx.DEFAULT_DIALOG_STYLE):
wx.Dialog.__init__(self,parent,ID, title, [200,200])
self.mediator = mediator
sizer = wx.BoxSizer(wx.V... | 30.675676 | 95 | 0.65815 |
e448d12b1f63a7b6da61fa481669d93fc14ea211 | 136 | py | Python | output/models/ms_data/complex_type/ct_e008_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/complex_type/ct_e008_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/complex_type/ct_e008_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.complex_type.ct_e008_xsd.ct_e008 import (
FooType,
Root,
)
__all__ = [
"FooType",
"Root",
]
| 13.6 | 68 | 0.647059 |
4c8a53fbb54ca4ba6bbc5af891cc9b2484357307 | 2,189 | py | Python | yolov4-keras-master/nets/ious.py | Eric030577/dissertation-master | 99e96a60f97259c6d8589f58073cf4fa0a7da4bc | [
"MIT"
] | null | null | null | yolov4-keras-master/nets/ious.py | Eric030577/dissertation-master | 99e96a60f97259c6d8589f58073cf4fa0a7da4bc | [
"MIT"
] | null | null | null | yolov4-keras-master/nets/ious.py | Eric030577/dissertation-master | 99e96a60f97259c6d8589f58073cf4fa0a7da4bc | [
"MIT"
] | null | null | null | from keras import backend as K
import tensorflow as tf
import math
def box_ciou(b1, b2):
"""
input:
----------
b1: tensor, shape=(batch, feat_w, feat_h, anchor_num, 4), xywh
b2: tensor, shape=(batch, feat_w, feat_h, anchor_num, 4), xywh
rerurn as
-------
ciou: tensor, shape=... | 40.537037 | 178 | 0.622202 |
5b276eb10077f25d981617b631e0e80a73dad613 | 13,142 | py | Python | venv/lib/python3.8/site-packages/ansible_test/_internal/config.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_test/_internal/config.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_test/_internal/config.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | """Configuration classes."""
from __future__ import annotations
import enum
import os
import sys
import typing as t
from .util import (
display,
verify_sys_executable,
version_to_str,
)
from .util_common import (
CommonConfig,
)
from .metadata import (
Metadata,
)
from .data import (
data_c... | 37.873199 | 147 | 0.646096 |
e294f15f6083ae523cb9a1af78a9a7e53a22f6fe | 18,878 | py | Python | python_modules/dagster/dagster/utils/__init__.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/utils/__init__.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/utils/__init__.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | null | null | null | import contextlib
import datetime
import errno
import functools
import inspect
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
from six.moves import co... | 30.253205 | 103 | 0.686619 |
9f6edae9eb7afcd634e314fc6922ddb18f3cfdd8 | 12,219 | py | Python | source/main.py | deith-ac/Catenary | 080926a77ea7b868c10d80132c1a955df571599b | [
"MIT"
] | 1 | 2020-12-02T14:53:58.000Z | 2020-12-02T14:53:58.000Z | source/main.py | deith-ac/Catenary | 080926a77ea7b868c10d80132c1a955df571599b | [
"MIT"
] | null | null | null | source/main.py | deith-ac/Catenary | 080926a77ea7b868c10d80132c1a955df571599b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import math
import matplotlib.pyplot as plt
# Precyzja Pythona dla liczba zmiennoprzecinkowych typu float to 53 bit
# w naszym przypadku niedokładności z tym związane są
# pomijalne. Nawet dla większych spadków i większych rozpiętości otrzymane
# wartości byłyby akceptowalne. Otrzymanie dokładn... | 31.737662 | 90 | 0.576234 |
8d35f4e573fcf36f0e1ad5b6be46d084d2be0d91 | 18,688 | py | Python | FOMC.py | lightlySkewed/FOMC_Sentiment_Macro_Data | 19164712d0c1433aa3827648501abc8d5f3fbee0 | [
"MIT"
] | null | null | null | FOMC.py | lightlySkewed/FOMC_Sentiment_Macro_Data | 19164712d0c1433aa3827648501abc8d5f3fbee0 | [
"MIT"
] | null | null | null | FOMC.py | lightlySkewed/FOMC_Sentiment_Macro_Data | 19164712d0c1433aa3827648501abc8d5f3fbee0 | [
"MIT"
] | null | null | null | {
"cells": [
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"%config Completer.use_jedi = False #for intellisense compatibility w/ Jupyter Notebook\n",
"\n",
"import pandas as pd\n",
"import numpy as np\n",
"import datetime as dt\n",
"i... | 33.193606 | 185 | 0.599743 |
5905179ac87ac80478312409c59ea5a7540f775b | 10,145 | py | Python | Viewer3d/VisPyViewer.py | acabrelles/protein-viewer | cc15994453b58a31789b93a9513ef9f087b5ad20 | [
"BSD-3-Clause"
] | 5 | 2017-12-14T07:11:40.000Z | 2021-07-03T14:46:23.000Z | Viewer3d/VisPyViewer.py | acabrelles/protein-viewer | cc15994453b58a31789b93a9513ef9f087b5ad20 | [
"BSD-3-Clause"
] | 3 | 2021-03-13T20:32:31.000Z | 2022-01-04T03:56:15.000Z | Viewer3d/VisPyViewer.py | acabrelles/protein-viewer | cc15994453b58a31789b93a9513ef9f087b5ad20 | [
"BSD-3-Clause"
] | 3 | 2017-12-03T19:27:41.000Z | 2021-03-13T23:10:09.000Z | # Code based on Luke Campagnola's Spheres visual, 2018.
import numpy as np
from vispy import app, gloo, visuals, scene
vertex = """
#version 120
uniform vec3 u_light_position;
uniform vec3 u_light_spec_position;
attribute vec3 a_position;
attribute vec3 a_color;
attribute float a_radius;
varying vec3 v_color;
v... | 35.472028 | 127 | 0.627501 |
3e343210e6c2117a9f6704fea9980d0d1ce98634 | 296 | py | Python | dags/emr/core/template/tc/practitioner_template.py | superoutput/airflow-data-analytics | dcd2280cc6e1448226540bfad3f11614353ea052 | [
"Apache-2.0"
] | null | null | null | dags/emr/core/template/tc/practitioner_template.py | superoutput/airflow-data-analytics | dcd2280cc6e1448226540bfad3f11614353ea052 | [
"Apache-2.0"
] | null | null | null | dags/emr/core/template/tc/practitioner_template.py | superoutput/airflow-data-analytics | dcd2280cc6e1448226540bfad3f11614353ea052 | [
"Apache-2.0"
] | null | null | null |
class PractitionerTemplate:
def __init__(self):
super().__init__()
def practitioner_default(self, data_list):
keys = []
for data in data_list:
key = f"{data.get('rowid')},{data.get('employee_id')}"
keys.append(key)
return keys
| 19.733333 | 66 | 0.567568 |
ebf1aee03b552bb6099326b7f970669b50c0aea6 | 33,757 | py | Python | parlai/tasks/task_list.py | TinaBBB/KBRD | 7d51520fd5a29d45caa4647d0c793ace95d94786 | [
"MIT"
] | 109 | 2019-09-05T02:10:53.000Z | 2022-03-28T02:58:29.000Z | parlai/tasks/task_list.py | TinaBBB/KBRD | 7d51520fd5a29d45caa4647d0c793ace95d94786 | [
"MIT"
] | 21 | 2019-09-18T13:42:58.000Z | 2022-03-26T23:14:05.000Z | parlai/tasks/task_list.py | TinaBBB/KBRD | 7d51520fd5a29d45caa4647d0c793ace95d94786 | [
"MIT"
] | 23 | 2019-09-05T11:00:29.000Z | 2022-03-03T03:12:38.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""This file contains a list of all the tasks, their id and task name, description
and the tags associated with them.
"""... | 37.095604 | 88 | 0.534763 |
04e98441da45cbf045ee558e6a5c2c8bf0e23841 | 199 | py | Python | src/pyrobot/version.py | stuart-fb/pyrobot | 2f06f337f84e2c0b172dcf5ee0cd8c7de73a50e1 | [
"MIT"
] | 6 | 2020-03-08T00:56:25.000Z | 2021-05-21T03:32:37.000Z | src/pyrobot/version.py | stuart-fb/pyrobot | 2f06f337f84e2c0b172dcf5ee0cd8c7de73a50e1 | [
"MIT"
] | 16 | 2020-01-28T22:49:47.000Z | 2022-03-11T23:51:24.000Z | src/pyrobot/version.py | stuart-fb/pyrobot | 2f06f337f84e2c0b172dcf5ee0cd8c7de73a50e1 | [
"MIT"
] | 2 | 2022-02-15T21:28:53.000Z | 2022-03-21T21:45:55.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
__version__ = '0.0.1'
| 28.428571 | 65 | 0.743719 |
d3c7f07d66d4c44692aa0869412c728bfea979f6 | 1,908 | py | Python | EC_Points_Generator.py | Nishaant215/Ellipitical-Curve-Table-Generator- | a73b53cbed46d34ae3020df303b459a94342b090 | [
"MIT"
] | 1 | 2022-01-02T00:36:56.000Z | 2022-01-02T00:36:56.000Z | EC_Points_Generator.py | Nishaant215/Ellipitical-Curve-Table-Generator- | a73b53cbed46d34ae3020df303b459a94342b090 | [
"MIT"
] | null | null | null | EC_Points_Generator.py | Nishaant215/Ellipitical-Curve-Table-Generator- | a73b53cbed46d34ae3020df303b459a94342b090 | [
"MIT"
] | null | null | null | # Finding the points (x,y) that satisfies y^2 = x^3 + a*x + b in Z(n)
def legendre(a, p):
return pow(a, (p - 1) // 2, p)
def tonelli_algo(n, p):
q = p - 1
s = 0
while q % 2 == 0:
q //= 2
s += 1
if s == 1:
return pow(n, (p + 1) // 4, p)
for z in range(2, p... | 25.105263 | 102 | 0.419287 |
bb5b24a8ecd6956caef3d46a14f1d318992db183 | 5,691 | py | Python | tests/integration_tests/test_sampler.py | adolfogonzalez3/optuna | 475efb1ef41bd95e8935286824e3be07c5de3c9a | [
"MIT"
] | 1 | 2020-07-16T09:28:48.000Z | 2020-07-16T09:28:48.000Z | tests/integration_tests/test_sampler.py | chrinide/optuna | aff8ca027a442f02e05a93f0885265b4a522dbc0 | [
"MIT"
] | null | null | null | tests/integration_tests/test_sampler.py | chrinide/optuna | aff8ca027a442f02e05a93f0885265b4a522dbc0 | [
"MIT"
] | null | null | null | from mock import patch
import pytest
import optuna
from optuna.integration import CmaEsSampler
from optuna.integration import SkoptSampler
from optuna.testing.sampler import FirstTrialOnlyRandomSampler
if optuna.types.TYPE_CHECKING:
from typing import Callable # NOQA
from optuna.samplers import BaseSampler ... | 35.12963 | 98 | 0.66614 |
6920be49b58b7ba21caee5ca2d0b2f777f5deb9b | 8,248 | py | Python | validitysensor/db.py | Mstrodl/python-validity | bc3cee30246022c30205f6c425e6619e43641955 | [
"MIT"
] | null | null | null | validitysensor/db.py | Mstrodl/python-validity | bc3cee30246022c30205f6c425e6619e43641955 | [
"MIT"
] | null | null | null | validitysensor/db.py | Mstrodl/python-validity | bc3cee30246022c30205f6c425e6619e43641955 | [
"MIT"
] | null | null | null | import typing
from .tls import tls
from .util import assert_status
from binascii import hexlify
from .blobs import db_write_enable
from .flash import call_cleanups
from .sid import *
class UserStorage():
def __init__(self, dbid, name):
self.dbid=dbid
self.name=name
self.users=[]
def _... | 31.723077 | 112 | 0.569593 |
4b37fadbe0aee27231ffac03d37e2cfd743adac2 | 1,039 | py | Python | chroma_agent/conf.py | whamcloud/iml-agent | fecb2468fd6edc822f3ab37ced444d98d8725730 | [
"MIT"
] | 1 | 2020-04-22T16:43:09.000Z | 2020-04-22T16:43:09.000Z | chroma_agent/conf.py | AlexTalker/iml-agent | 5ebcfe96be670912d9a9b7fbb23431af0d54f768 | [
"MIT"
] | 53 | 2018-07-07T18:17:50.000Z | 2021-03-19T23:15:28.000Z | chroma_agent/conf.py | AlexTalker/iml-agent | 5ebcfe96be670912d9a9b7fbb23431af0d54f768 | [
"MIT"
] | 6 | 2018-06-18T08:51:38.000Z | 2019-10-24T12:16:42.000Z | # Copyright (c) 2018 DDN. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import os
ENV_PATH = "/etc/iml"
def set_server_url(url):
if not os.path.exists(ENV_PATH):
os.makedirs(ENV_PATH)
with open("{}/manager-url.conf".format... | 25.975 | 75 | 0.629451 |
7810f468f2db42c96381000c891efe1609ba31a0 | 585 | py | Python | websites/migrations/0012_auto_20200625_1805.py | tsukasa-renato/personal-project-django-system | e36c8218640175346f712beb5a1cba602d877fa9 | [
"MIT"
] | null | null | null | websites/migrations/0012_auto_20200625_1805.py | tsukasa-renato/personal-project-django-system | e36c8218640175346f712beb5a1cba602d877fa9 | [
"MIT"
] | 5 | 2021-04-08T19:21:07.000Z | 2021-09-22T19:14:37.000Z | websites/migrations/0012_auto_20200625_1805.py | tsukasarenato/simple-web-application | ae845973e2d74606777ef90353a2db7875e4e077 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-06-25 21:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('websites', '0011_auto_20200623_1401'),
]
operations = [
migrations.AddField(
model_name='websites',
name='home',
... | 24.375 | 71 | 0.589744 |
8e2b97b5e9bf4b2c295c8fc8b94f2b53ab60b9e0 | 3,233 | py | Python | sapi/auth.py | UFResearchComputing/slurm-api | 80c70eb5be37d64895772aff63611e1a4f7fe3b0 | [
"MIT"
] | 5 | 2019-08-08T15:04:02.000Z | 2021-02-19T07:10:22.000Z | sapi/auth.py | UFResearchComputing/slurm-api | 80c70eb5be37d64895772aff63611e1a4f7fe3b0 | [
"MIT"
] | 1 | 2019-08-08T15:26:18.000Z | 2020-02-19T16:03:31.000Z | sapi/auth.py | UFResearchComputing/slurm-api | 80c70eb5be37d64895772aff63611e1a4f7fe3b0 | [
"MIT"
] | 2 | 2020-06-29T19:15:50.000Z | 2021-04-27T09:50:43.000Z | #/* ************************************************************************* */
#/* ************************************************************************* */
#/* Description: slurm-api jwt token methods */
#/* Authors: ... | 40.924051 | 80 | 0.366533 |
7991e9ff93a64ef43bd4a1efeb81cda2501d6daf | 169 | py | Python | venv/Lib/site-packages/torchvision/version.py | countBMB/BenjiRepo | 79d882263baaf2a11654ca67d2e5593074d36dfa | [
"Apache-2.0"
] | 1 | 2020-02-24T06:23:07.000Z | 2020-02-24T06:23:07.000Z | venv/Lib/site-packages/torchvision/version.py | countBMB/BenjiRepo | 79d882263baaf2a11654ca67d2e5593074d36dfa | [
"Apache-2.0"
] | 4 | 2021-06-02T00:49:27.000Z | 2022-01-13T01:59:34.000Z | venv/Lib/site-packages/torchvision/version.py | countBMB/BenjiRepo | 79d882263baaf2a11654ca67d2e5593074d36dfa | [
"Apache-2.0"
] | null | null | null | __version__ = '0.4.2+cpu'
git_version = 'efb0b265ce62bb9205ba93701628c4b57012001c'
from torchvision import _C
if hasattr(_C, 'CUDA_VERSION'):
cuda = _C.CUDA_VERSION
| 28.166667 | 56 | 0.781065 |
b08eb0515579ce4f6327e3b181a6ce022ceae542 | 3,202 | py | Python | commands/headcrab.py | Stereo528/Osmium | cd17912b2cd559238b25c75f2d53785c72452aca | [
"MIT"
] | 2 | 2021-12-15T10:50:45.000Z | 2022-02-15T13:15:30.000Z | commands/headcrab.py | Stereo528/Osmium | cd17912b2cd559238b25c75f2d53785c72452aca | [
"MIT"
] | null | null | null | commands/headcrab.py | Stereo528/Osmium | cd17912b2cd559238b25c75f2d53785c72452aca | [
"MIT"
] | null | null | null | import discord, json
from discord.ext import commands
from random import randint
from main import embedCreator, getAlias
class Fun(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(aliases=getAlias("headcrab"))
async def headcrab(self, ctx, member: discord.Member=N... | 47.088235 | 281 | 0.593691 |
2bc2995c162c642687139f5bb51e60ec1272d113 | 1,023 | py | Python | netket/_jitclass.py | vigsterkr/netket | 1e187ae2b9d2aa3f2e53b09fe743e50763d04c9a | [
"Apache-2.0"
] | null | null | null | netket/_jitclass.py | vigsterkr/netket | 1e187ae2b9d2aa3f2e53b09fe743e50763d04c9a | [
"Apache-2.0"
] | null | null | null | netket/_jitclass.py | vigsterkr/netket | 1e187ae2b9d2aa3f2e53b09fe743e50763d04c9a | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Simons Foundation, Inc. - All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 37.888889 | 74 | 0.768328 |
b94e6f8aeb98d855eaa70cf4178bd53dca9b8d7a | 744 | py | Python | azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # 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.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 26.571429 | 76 | 0.567204 |
44c2a6b4f45bb4627de51e0a92d34fa05911029c | 699 | py | Python | application/models.py | kishanvekaria/Pokedex | 493343a8094051dcf1c7a69d50417212cfd11acc | [
"MIT"
] | null | null | null | application/models.py | kishanvekaria/Pokedex | 493343a8094051dcf1c7a69d50417212cfd11acc | [
"MIT"
] | null | null | null | application/models.py | kishanvekaria/Pokedex | 493343a8094051dcf1c7a69d50417212cfd11acc | [
"MIT"
] | 1 | 2021-02-06T12:53:07.000Z | 2021-02-06T12:53:07.000Z | from application import db
class Pokedata(db.Model):
id = db.Column(db.Integer, primary_key =True)
poke_id = db.Column(db.Integer)
name = db.Column(db.String(30))
poketype = db.Column(db.String(30))
caught_pokemon = db.relationship('Caught', backref = 'poke_name')
#def __repr__(self):
#... | 33.285714 | 71 | 0.672389 |
2c874bcc16c84a9b5d1988f130782177baaf71ba | 2,939 | py | Python | examples/all_ine_one_tuning/all_in_one_multiclass.py | c60evaporator/param-tuning-utility | 80625f875428badac37d8439195a9327a565b040 | [
"BSD-3-Clause"
] | null | null | null | examples/all_ine_one_tuning/all_in_one_multiclass.py | c60evaporator/param-tuning-utility | 80625f875428badac37d8439195a9327a565b040 | [
"BSD-3-Clause"
] | null | null | null | examples/all_ine_one_tuning/all_in_one_multiclass.py | c60evaporator/param-tuning-utility | 80625f875428badac37d8439195a9327a565b040 | [
"BSD-3-Clause"
] | 1 | 2022-01-06T05:13:07.000Z | 2022-01-06T05:13:07.000Z | # %% AllInOneTuning, multiclass, no argument
import parent_import
from tune_easy import AllInOneTuning
import seaborn as sns
# Load dataset
iris = sns.load_dataset("iris")
TARGET_VARIALBLE = 'species' # Target variable name
USE_EXPLANATORY = ['petal_width', 'petal_length', 'sepal_width', 'sepal_length'] # Selected ex... | 44.530303 | 151 | 0.556992 |
bec71b35a824f3f8f230467946dde77753e0a1aa | 5,895 | py | Python | tools/create_triage_tickets.py | omertuc/assisted-installer-deployment | 90a50d1749db280e3fa6ee2cb2f1f6a6463b71b3 | [
"Apache-2.0"
] | null | null | null | tools/create_triage_tickets.py | omertuc/assisted-installer-deployment | 90a50d1749db280e3fa6ee2cb2f1f6a6463b71b3 | [
"Apache-2.0"
] | null | null | null | tools/create_triage_tickets.py | omertuc/assisted-installer-deployment | 90a50d1749db280e3fa6ee2cb2f1f6a6463b71b3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# This script gets a list of the filed clusters from the assisted-logs-server
# For each cluster, which does not already has a triaging Jira ticket, it creates one
#
import argparse
import logging
import netrc
import os
import sys
from urllib.parse import urlparse
import requests
import jira
im... | 34.881657 | 111 | 0.638338 |
21111b35b6c86b3a3e691a39eb5d39cde673d284 | 6,692 | py | Python | examples/Deeplab/experiments/resnet_model_edge_conv3.py | MarcWong/tensorpack | 51ab279480dc1e3ffdc07884a9e8149dea9651e9 | [
"Apache-2.0"
] | 5 | 2018-05-04T02:04:15.000Z | 2020-04-02T05:38:48.000Z | examples/Deeplab/experiments/resnet_model_edge_conv3.py | MarcWong/tensorpack | 51ab279480dc1e3ffdc07884a9e8149dea9651e9 | [
"Apache-2.0"
] | null | null | null | examples/Deeplab/experiments/resnet_model_edge_conv3.py | MarcWong/tensorpack | 51ab279480dc1e3ffdc07884a9e8149dea9651e9 | [
"Apache-2.0"
] | 2 | 2018-04-23T13:43:10.000Z | 2019-10-30T09:56:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: resnet_model.py
import tensorflow as tf
from tensorflow.contrib.layers import variance_scaling_initializer
from tensorpack.tfutils.argscope import argscope, get_arg_scope
from tensorpack.models import (
Conv2D, GlobalAvgPooling, BatchNorm, BNReLU, FullyConnec... | 41.308642 | 134 | 0.653766 |
e409b1d433fc079967af794417c9e47551e5df05 | 3,758 | py | Python | parserator/utils.py | fossilCreek/Parserator-training_process | 04a1b0400a875e5494ab153a469e33e50901e68f | [
"MIT"
] | 785 | 2015-01-07T05:31:46.000Z | 2022-03-07T18:57:35.000Z | parserator/utils.py | afcarl/parserator | 4dc69b0d115bf33e2d169ff40b05143257a5f481 | [
"MIT"
] | 42 | 2015-01-03T17:53:28.000Z | 2021-05-23T22:03:43.000Z | parserator/utils.py | afcarl/parserator | 4dc69b0d115bf33e2d169ff40b05143257a5f481 | [
"MIT"
] | 101 | 2015-01-13T05:05:32.000Z | 2022-03-13T05:29:57.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from sklearn.metrics import f1_score
from sklearn.base import BaseEstimator
from sklearn.grid_search import GridSearchCV
from training import get_data_sklearn_format
import pycrfsuite
def f1_with_flattening(estimator, X, y):
"""
... | 36.485437 | 114 | 0.637573 |
edfcde28c15229218c36b9e044ac5c5ab2bb2e80 | 8,402 | py | Python | sentry/web/urls.py | davedash/sentry | 8c11b2db7f09844aa860bfe7f1c3ff23c0d30f94 | [
"BSD-3-Clause"
] | null | null | null | sentry/web/urls.py | davedash/sentry | 8c11b2db7f09844aa860bfe7f1c3ff23c0d30f94 | [
"BSD-3-Clause"
] | null | null | null | sentry/web/urls.py | davedash/sentry | 8c11b2db7f09844aa860bfe7f1c3ff23c0d30f94 | [
"BSD-3-Clause"
] | null | null | null | """
sentry.web.urls
~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
from django.conf.urls.defaults import *
from sentry.web import api
from sentry.web.frontend import accounts, generic, groups, events, \
project... | 53.858974 | 177 | 0.650678 |
7253ee566864e0b1c59e9cedbf2c1223b1424179 | 552 | py | Python | writemetadata.py | mb-89/x2df | ea839083321b865b347a0fcaa11dfe2ec99ce7ec | [
"MIT"
] | null | null | null | writemetadata.py | mb-89/x2df | ea839083321b865b347a0fcaa11dfe2ec99ce7ec | [
"MIT"
] | 2 | 2022-01-19T07:21:27.000Z | 2022-01-19T14:48:39.000Z | writemetadata.py | mb-89/x2df | ea839083321b865b347a0fcaa11dfe2ec99ce7ec | [
"MIT"
] | null | null | null | import configparser
from contextlib import redirect_stdout
import os.path as op
from src.x2df import x2df
# write version to source code
cfg = configparser.ConfigParser()
cfg.read("setup.cfg")
lines = ["# this file is autogenerated on pre-commit"]
lines.append('__version__ = "' + cfg["metadata"]["version"] + '"')
line... | 27.6 | 69 | 0.699275 |
a1304ba329da6ce6dc894a00d6d02220f5f9a946 | 1,114 | py | Python | Code/n-arytree.py | Rediet8abere/CS1.3-Core-Data-Structure- | 81a728f589e43d36be83fa84ab985b7cbc0aba5c | [
"MIT"
] | null | null | null | Code/n-arytree.py | Rediet8abere/CS1.3-Core-Data-Structure- | 81a728f589e43d36be83fa84ab985b7cbc0aba5c | [
"MIT"
] | 7 | 2020-02-15T16:26:58.000Z | 2020-03-09T20:59:21.000Z | Code/n-arytree.py | Rediet8abere/CS-1.3-Core-Data-Structures | 81a728f589e43d36be83fa84ab985b7cbc0aba5c | [
"MIT"
] | null | null | null |
class NaryTreeNode(object):
def __init__(self, data=None):
"""Initialize this n-ary tree node with the given data."""
self.data = data
self.children = []
def __repr__(self):
"""Return a string representation of this n-ary tree node."""
return 'NaryTreeNode({!r})'.format... | 27.170732 | 72 | 0.573609 |
2766a660cbcb38ec0c8326b159428b0c3dea6bac | 17,226 | py | Python | docs/experiments/functions/xor_rxor_functions.py | KhelmholtzR/ProgLearn | f5177c720e53d2f5936272998b94e0746135a3b9 | [
"MIT"
] | 18 | 2020-10-13T00:43:06.000Z | 2022-03-28T09:03:52.000Z | docs/experiments/functions/xor_rxor_functions.py | KhelmholtzR/ProgLearn | f5177c720e53d2f5936272998b94e0746135a3b9 | [
"MIT"
] | 234 | 2020-10-04T17:19:15.000Z | 2022-03-17T15:43:57.000Z | docs/experiments/functions/xor_rxor_functions.py | KhelmholtzR/ProgLearn | f5177c720e53d2f5936272998b94e0746135a3b9 | [
"MIT"
] | 31 | 2020-10-05T07:43:50.000Z | 2022-03-03T21:45:57.000Z | import numpy as np
import random
from math import log2, ceil
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
from proglearn.forest import LifelongClassificationForest, UncertaintyForest
from proglearn.sims import *
from proglearn.progressive_learner import Progress... | 32.625 | 88 | 0.609602 |
835cd1babe9ca1f163b0f0fd3ce57fae11e5b118 | 988 | py | Python | NewsRecommendation/src/main.py | ustcsky/recommenders | 64f0dd4653cf7f1d687c45c61807841415e111c7 | [
"MIT"
] | null | null | null | NewsRecommendation/src/main.py | ustcsky/recommenders | 64f0dd4653cf7f1d687c45c61807841415e111c7 | [
"MIT"
] | null | null | null | NewsRecommendation/src/main.py | ustcsky/recommenders | 64f0dd4653cf7f1d687c45c61807841415e111c7 | [
"MIT"
] | null | null | null | # coding:utf-8
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1"
import torch
from option import args
from preprocess import preprocess_data
from loader import Loader
from model import Model
from trainer import Trainer
import numpy as np
torch.manual_seed(args.seed)
def main():
print('Start')
if args.pre:... | 24.097561 | 79 | 0.681174 |
44f230a7b6fd9c8d6f604cc44b0c0ac4e7698233 | 4,168 | py | Python | app/utils/parsers.py | martamatos/kinetics_db | 2fd152a46be0b28d56d504a528b8a8b4f543dedd | [
"MIT"
] | null | null | null | app/utils/parsers.py | martamatos/kinetics_db | 2fd152a46be0b28d56d504a528b8a8b4f543dedd | [
"MIT"
] | 5 | 2019-02-26T15:02:27.000Z | 2020-04-02T22:00:47.000Z | app/utils/parsers.py | martamatos/kinetics_db | 2fd152a46be0b28d56d504a528b8a8b4f543dedd | [
"MIT"
] | null | null | null | from builtins import object
from re import compile
from collections import OrderedDict
class ReactionParser(object):
"""
ReactionParser class, whose goal is to parse a reaction string in the format: A_c + B_c <-> P_c
"""
def __init__(self):
id_re = '[a-zA-Z]\w*'
pos_float_re = '\d+(?... | 34.163934 | 118 | 0.567898 |
122b4bb655e18d09648289f1a90f8f17a521c74d | 1,101 | py | Python | src/dietpdf/item/PDFNull.py | Zigazou/dietpdf | 4608ea2d9d54861d4d894b725a60895e0bdc131a | [
"MIT"
] | 6 | 2022-02-07T06:17:41.000Z | 2022-02-15T17:29:16.000Z | src/dietpdf/item/PDFNull.py | Zigazou/dietpdf | 4608ea2d9d54861d4d894b725a60895e0bdc131a | [
"MIT"
] | 2 | 2022-02-08T10:00:08.000Z | 2022-02-08T12:59:42.000Z | src/dietpdf/item/PDFNull.py | Zigazou/dietpdf | 4608ea2d9d54861d4d894b725a60895e0bdc131a | [
"MIT"
] | null | null | null | __author__ = "Frédéric BISSON"
__copyright__ = "Copyright 2022, Frédéric BISSON"
__credits__ = ["Frédéric BISSON"]
__license__ = "mit"
__maintainer__ = "Frédéric BISSON"
__email__ = "zigazou@protonmail.com"
from ..token.PDFToken import PDFToken
from .PDFItem import PDFItem
class PDFNull(PDFItem):
"""A null valu... | 25.022727 | 66 | 0.62852 |
1ae801390a74ffdf26dd586d52afbf3185a44fcd | 581 | py | Python | hardhat/recipes/python/ipython.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/python/ipython.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/python/ipython.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | from .base import PipBaseRecipe
class IPythonRecipe(PipBaseRecipe):
def __init__(self, *args, **kwargs):
super(IPythonRecipe, self).__init__(*args, **kwargs)
self.sha256 = '7ef4694e1345913182126b219aaa4a00' \
'47e191af414256da6772cf249571b961'
self.name = 'ipython'
... | 34.176471 | 60 | 0.535284 |
fdb321c3a076b21b2ee633bfb027999ac7980312 | 1,072 | py | Python | cogs/top_gg_api.py | albertopoljak/MemberLicenseKey-DiscordBot | ae40f8a1c3c628b738adc23eed996e8270517784 | [
"MIT"
] | null | null | null | cogs/top_gg_api.py | albertopoljak/MemberLicenseKey-DiscordBot | ae40f8a1c3c628b738adc23eed996e8270517784 | [
"MIT"
] | null | null | null | cogs/top_gg_api.py | albertopoljak/MemberLicenseKey-DiscordBot | ae40f8a1c3c628b738adc23eed996e8270517784 | [
"MIT"
] | 1 | 2019-08-09T01:21:14.000Z | 2019-08-09T01:21:14.000Z | import logging
import dbl
from discord.ext import commands, tasks
logger = logging.getLogger(__name__)
class TopGGApi(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.dbl_client = dbl.DBLClient(self.bot, self.bot.config["top_gg_api_... | 29.777778 | 92 | 0.675373 |
0db83e68b9e4a19f596756729d5d7687e888abca | 586 | py | Python | tests/test_checks.py | thewchan/flake8-multiline-containers | 921f48eec5ad4b6b12c150d2c0c1d6fd412539b8 | [
"MIT"
] | 10 | 2019-06-03T22:48:13.000Z | 2021-06-14T09:01:42.000Z | tests/test_checks.py | thewchan/flake8-multiline-containers | 921f48eec5ad4b6b12c150d2c0c1d6fd412539b8 | [
"MIT"
] | 22 | 2019-07-10T18:49:58.000Z | 2022-03-18T12:58:32.000Z | tests/test_checks.py | thewchan/flake8-multiline-containers | 921f48eec5ad4b6b12c150d2c0c1d6fd412539b8 | [
"MIT"
] | 3 | 2019-10-12T20:01:24.000Z | 2021-11-06T20:38:48.000Z | from flake8_multiline_containers import ErrorCodes
def test_check_opening_contains_error(linter):
line = "foo={a\n"
curly_matches = linter._number_of_matches_in_line(
'{', '}', line,
)
linter._check_opening('{', '}', curly_matches, 0, line, ErrorCodes.JS101)
assert 1 == len(linter.errors... | 24.416667 | 77 | 0.665529 |
0e6e631e84989a7f11b1b8b8666141f49edbaf96 | 20,792 | py | Python | tests/test_templateconfiguration.py | simonkowallik/as3ninja | f9997dfa0e26d481452c727fe2c2a03a811e189a | [
"0BSD"
] | 7 | 2019-11-07T21:19:50.000Z | 2021-12-22T15:03:59.000Z | tests/test_templateconfiguration.py | simonkowallik/as3ninja | f9997dfa0e26d481452c727fe2c2a03a811e189a | [
"0BSD"
] | 63 | 2019-11-09T21:07:09.000Z | 2022-01-31T17:44:55.000Z | tests/test_templateconfiguration.py | simonkowallik/as3ninja | f9997dfa0e26d481452c727fe2c2a03a811e189a | [
"0BSD"
] | 3 | 2019-11-20T17:32:18.000Z | 2021-03-01T19:47:00.000Z | import json
from pathlib import Path
import pytest
from pydantic import ValidationError
from as3ninja.exceptions import AS3TemplateConfigurationError
from as3ninja.templateconfiguration import AS3TemplateConfiguration
from .utils import format_json
class Test_TemplateConfigurationValidator:
@pytest.mark.parame... | 35.91019 | 119 | 0.593113 |
264c28499a75de736eafbdae1e2c5c0a0585e183 | 8,920 | py | Python | code/drive_rover.py | ajnunezr/RoboND_Rover_Project1 | 188a5418d8f097fa3b54c425e46b67859b90674e | [
"MIT"
] | 1 | 2019-03-09T13:12:00.000Z | 2019-03-09T13:12:00.000Z | code/drive_rover.py | ajnunezr/RoboND_Rover_Project1 | 188a5418d8f097fa3b54c425e46b67859b90674e | [
"MIT"
] | null | null | null | code/drive_rover.py | ajnunezr/RoboND_Rover_Project1 | 188a5418d8f097fa3b54c425e46b67859b90674e | [
"MIT"
] | 2 | 2018-09-04T16:51:38.000Z | 2019-03-09T12:15:42.000Z | # Do the necessary imports
import argparse
import shutil
import base64
from datetime import datetime
import os
import cv2
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO, StringIO
import json
import pickle
import matplotlib.ima... | 38.283262 | 96 | 0.66065 |
a6e9aee24d2f6817518a25c0bf0b62a951b157bf | 14,213 | py | Python | Geometry/HcalCommonData/test/python/step3_RAW2DIGI_L1Reco_RECO_RECOSIM_PAT_VALIDATION_DQM_10024.911.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | null | null | null | Geometry/HcalCommonData/test/python/step3_RAW2DIGI_L1Reco_RECO_RECOSIM_PAT_VALIDATION_DQM_10024.911.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | null | null | null | Geometry/HcalCommonData/test/python/step3_RAW2DIGI_L1Reco_RECO_RECOSIM_PAT_VALIDATION_DQM_10024.911.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | null | null | null | # Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: step3 -s RAW2DIGI,L1Reco,RECO,RECOSIM,PAT,VALIDATION:@standardValidationNoHLT+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM --cond... | 53.837121 | 1,417 | 0.798213 |
520d07419fcbd7761697bd4f4867e66c12c150f2 | 4,638 | py | Python | stem_cell_hypothesis/zh_albert_base/joint/dep_con.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | 4 | 2021-09-17T15:23:31.000Z | 2022-02-28T10:18:04.000Z | stem_cell_hypothesis/zh_albert_base/joint/dep_con.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | stem_cell_hypothesis/zh_albert_base/joint/dep_con.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-01-06 16:12
from typing import List
from elit.common.dataset import SortingSamplerBuilder
from elit.common.transform import NormalizeToken
from elit.components.mtl.loss_balancer import MovingAverageBalancer
from elit.components.mtl.multi_task_learning import MultiTa... | 39.982759 | 121 | 0.6326 |
cf49819450950877229aa54784242f65e3fff2d5 | 770 | py | Python | blockchain-workbench/rest-api-samples/python/runit.py | Amirh24/blockchain | a71a09f4bf17c14286f0fe6d278b7c2481fce87b | [
"MIT"
] | 738 | 2018-05-07T15:37:38.000Z | 2022-03-30T08:16:04.000Z | blockchain-workbench/rest-api-samples/python/runit.py | Amirh24/blockchain | a71a09f4bf17c14286f0fe6d278b7c2481fce87b | [
"MIT"
] | 156 | 2018-05-08T14:01:25.000Z | 2022-01-31T22:03:32.000Z | blockchain-workbench/rest-api-samples/python/runit.py | Amirh24/blockchain | a71a09f4bf17c14286f0fe6d278b7c2481fce87b | [
"MIT"
] | 682 | 2018-05-07T16:45:10.000Z | 2022-03-31T16:50:13.000Z | import json
import os
import sys
import adal
import swagger_client
from pprint import pprint
from swagger_client.api_client import ApiClient
def main():
authority_url = 'https://login.windows.net/[Your Tenant]'
client_id = '[Your client_id]'
client_secret = '[Your secret]'
context = adal.Authentication... | 32.083333 | 90 | 0.768831 |
c83b94fb4904e085cfb932a5b7d99ad437591855 | 392 | py | Python | objects_and_classes/exercise/04_town.py | Galchov/python-fundamentals | 4939bdd1c66a7b458fd9ffd0a01d714de26724b5 | [
"MIT"
] | null | null | null | objects_and_classes/exercise/04_town.py | Galchov/python-fundamentals | 4939bdd1c66a7b458fd9ffd0a01d714de26724b5 | [
"MIT"
] | null | null | null | objects_and_classes/exercise/04_town.py | Galchov/python-fundamentals | 4939bdd1c66a7b458fd9ffd0a01d714de26724b5 | [
"MIT"
] | null | null | null | class Town:
def __init__(self, name):
self.name = name
self.latitude = None
self.longitude = None
def set_latitude(self, latitude):
self.latitude = latitude
def set_longitude(self, longitude):
self.longitude = longitude
def __repr__(self):
return f"Town... | 28 | 93 | 0.630102 |
be9ca3cb1b7947447658a1c6fbdba34a4319c634 | 673 | py | Python | app/core/management/commands/wait_for_db.py | tinpeterna/recipe-app-api | 41341566dd9868a05033ff2d053d1b72d90ce72e | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | tinpeterna/recipe-app-api | 41341566dd9868a05033ff2d053d1b72d90ce72e | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | tinpeterna/recipe-app-api | 41341566dd9868a05033ff2d053d1b72d90ce72e | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until database is available"""
def handle(self, *args, **options):
self.stdout.write('Waiting ... | 35.421053 | 78 | 0.650817 |
8e113952e4555c451edc8c50f522b098810ff292 | 3,978 | py | Python | experiments/deep_learning/src/utils.py | ntnu-ai-lab/harth-ml-experiments | 4b4eefa27db111665c23c697005916703eac0a2c | [
"MIT"
] | 3 | 2022-03-12T19:22:24.000Z | 2022-03-29T21:03:25.000Z | experiments/deep_learning/src/utils.py | ntnu-ai-lab/harth-ml-experiments | 4b4eefa27db111665c23c697005916703eac0a2c | [
"MIT"
] | null | null | null | experiments/deep_learning/src/utils.py | ntnu-ai-lab/harth-ml-experiments | 4b4eefa27db111665c23c697005916703eac0a2c | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import sklearn
import sklearn.model_selection
import os
import pickle
def grid_search(args):
"""
Wrapper around sklearn's parameter grid. Mends
dict values that are not wrapped in list
"""
args = args if isinstance(args, (list, tuple)) else [args]
return ... | 34.293103 | 84 | 0.622423 |
c902a5f91fa576ba6b0425aadf8ea966c58d644a | 4,035 | py | Python | tests/test_fsdict.py | ABitMoreDepth/persistent_structures | 98a61bfd9bb560ae952ee04d8ebda7297ca74b51 | [
"MIT"
] | null | null | null | tests/test_fsdict.py | ABitMoreDepth/persistent_structures | 98a61bfd9bb560ae952ee04d8ebda7297ca74b51 | [
"MIT"
] | 4 | 2019-10-13T20:37:21.000Z | 2019-10-13T20:38:42.000Z | tests/test_fsdict.py | ABitMoreDepth/persistent_structures | 98a61bfd9bb560ae952ee04d8ebda7297ca74b51 | [
"MIT"
] | null | null | null | """Tests to cover the fsdict class."""
import os
from random import randint
import pytest
from persistent_structures.fsdict import FSDict
def test_delitem() -> None:
"""Verify Files are correctly deleted when deleting a key from the FSDict."""
temp_file_path = os.path.join(os.path.curdir, 'test_delitem{}'.... | 29.888889 | 93 | 0.649814 |
0c32c245f434f79513994d752f436674d3a667de | 2,848 | py | Python | syllogistic-generalized/Seminar2020/models/Baselines/MFA/mfa.py | monthie/cogmods | 62af4b8bf2effb77f26a8877d6a89949164d83f0 | [
"MIT"
] | null | null | null | syllogistic-generalized/Seminar2020/models/Baselines/MFA/mfa.py | monthie/cogmods | 62af4b8bf2effb77f26a8877d6a89949164d83f0 | [
"MIT"
] | 11 | 2020-05-04T09:05:29.000Z | 2021-04-08T13:22:34.000Z | syllogistic-generalized/Seminar2020/models/Baselines/MFA/mfa.py | monthie/cogmods | 62af4b8bf2effb77f26a8877d6a89949164d83f0 | [
"MIT"
] | 12 | 2020-05-02T09:36:14.000Z | 2021-06-22T08:10:45.000Z | """ Implementation of the most-frequent answer (MFA) model which predicts responses based on the
most-frequently selected choice from the available background (training) data.
"""
import collections
import ccobra
import numpy as np
class MFAModel(ccobra.CCobraModel):
def __init__(self, name='MFA'):
sup... | 28.19802 | 96 | 0.590941 |
c57cf5fc1ef33a61e1a65352edf642458fba35ff | 2,641 | py | Python | deepcell/losses_test.py | BioMeasure/deepcell-tf | e8912c9e4a7160900e8d9dc2616a03dfa47fd53f | [
"Apache-2.0"
] | 1 | 2020-12-05T14:59:18.000Z | 2020-12-05T14:59:18.000Z | deepcell/losses_test.py | BioMeasure/deepcell-tf | e8912c9e4a7160900e8d9dc2616a03dfa47fd53f | [
"Apache-2.0"
] | null | null | null | deepcell/losses_test.py | BioMeasure/deepcell-tf | e8912c9e4a7160900e8d9dc2616a03dfa47fd53f | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2020 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 36.178082 | 80 | 0.702385 |
c8f639bebe216507f45ba3c4054bd21d3e7e11a2 | 12,074 | py | Python | Codigos/NYT/NYT 2016.py | rafgui12/Newspaper-Library | 96de4f91a25fa06e7bfb8b8f5981b032fb7b8bf8 | [
"Unlicense"
] | null | null | null | Codigos/NYT/NYT 2016.py | rafgui12/Newspaper-Library | 96de4f91a25fa06e7bfb8b8f5981b032fb7b8bf8 | [
"Unlicense"
] | null | null | null | Codigos/NYT/NYT 2016.py | rafgui12/Newspaper-Library | 96de4f91a25fa06e7bfb8b8f5981b032fb7b8bf8 | [
"Unlicense"
] | null | null | null | # importing the requests library
import requests
import numpy as np
import os
import time
# Cadenas de Pais Y Palabras
country = ["Colombia","Canada","Cuba","China","Cameroon","Cambodia","Costa Rica","Croatia","Czech Republic","Argentina"]
country2 = ["Afghanistan","Australia","Algeria","Austria","Brazil","Bolivia"... | 35.827893 | 137 | 0.509276 |
c3ff782503c59093e4a74e725f7c97a5511be903 | 659 | py | Python | tests/datatypes/test-IDREFS.py | thorstenb/pyxb | 634e86f61dfb73a2900f32fc3d819e9c25365a49 | [
"Apache-2.0"
] | null | null | null | tests/datatypes/test-IDREFS.py | thorstenb/pyxb | 634e86f61dfb73a2900f32fc3d819e9c25365a49 | [
"Apache-2.0"
] | null | null | null | tests/datatypes/test-IDREFS.py | thorstenb/pyxb | 634e86f61dfb73a2900f32fc3d819e9c25365a49 | [
"Apache-2.0"
] | null | null | null | from pyxb.exceptions_ import *
import unittest
import pyxb.binding.datatypes as xsd
class Test_IDREFS (unittest.TestCase):
def testBasicLists (self):
v = xsd.IDREFS([ "one", "two", "three" ])
self.assertEqual(3, len(v))
self.assertTrue(isinstance(v[0], xsd.IDREF))
self.assertEqual("... | 31.380952 | 78 | 0.638847 |
6efc71787eba8746e0ccb68c388a77ecffbbd9df | 4,249 | py | Python | blueapps/contrib/bk_commands/management/commands/startwxapp.py | xianmao/bk-sops | 2bc89a81f332122ef215adb9b7dc82641f35eb70 | [
"Apache-2.0"
] | null | null | null | blueapps/contrib/bk_commands/management/commands/startwxapp.py | xianmao/bk-sops | 2bc89a81f332122ef215adb9b7dc82641f35eb70 | [
"Apache-2.0"
] | null | null | null | blueapps/contrib/bk_commands/management/commands/startwxapp.py | xianmao/bk-sops | 2bc89a81f332122ef215adb9b7dc82641f35eb70 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import io
import os
import sys
import shutil
from os import path
import django
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.conf import settings
import blueapps
PY_VER = sys.version
class Command(TemplateCommand... | 37.9375 | 95 | 0.534714 |
9619e6e1cc90944a0199fd69d2645401a7e55c7a | 2,981 | py | Python | telemetry/telemetry/internal/platform/gpu_info_unittest.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | telemetry/telemetry/internal/platform/gpu_info_unittest.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | telemetry/telemetry/internal/platform/gpu_info_unittest.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2013 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.
import unittest
from telemetry.internal.platform import gpu_device
from telemetry.internal.platform import gpu_info
class TestGPUInfo(unittest.TestCase):
... | 35.915663 | 76 | 0.64475 |
12ec3f851fd30da0fa086250ead6efc66f6735fa | 14,278 | py | Python | synapse/http/site.py | fhirfactory/synapse | 924d677a76e68a0ba047ecf41a7d06cbe3d7374c | [
"Apache-2.0"
] | null | null | null | synapse/http/site.py | fhirfactory/synapse | 924d677a76e68a0ba047ecf41a7d06cbe3d7374c | [
"Apache-2.0"
] | null | null | null | synapse/http/site.py | fhirfactory/synapse | 924d677a76e68a0ba047ecf41a7d06cbe3d7374c | [
"Apache-2.0"
] | 1 | 2021-09-27T14:45:52.000Z | 2021-09-27T14:45:52.000Z | # Copyright 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 applicable law or agreed to in writin... | 36.894057 | 90 | 0.636994 |
1de84388e767bd88ba8c7e9736bb8862679415f9 | 2,893 | py | Python | ne/data/ids2017/__init__.py | mitchgrout/COMPX592 | a77e37aad00344cb8a5067558f67e1117accccf0 | [
"MIT"
] | null | null | null | ne/data/ids2017/__init__.py | mitchgrout/COMPX592 | a77e37aad00344cb8a5067558f67e1117accccf0 | [
"MIT"
] | null | null | null | ne/data/ids2017/__init__.py | mitchgrout/COMPX592 | a77e37aad00344cb8a5067558f67e1117accccf0 | [
"MIT"
] | null | null | null | """
ne.data.ids2017
CIC IDS 2017 data
"""
from ne.data import Dataset
def loader():
from os.path import exists
import wget
import zipfile
urlf = 'http://205.174.165.80/CICDataset/CIC-IDS-2017/Dataset/{}'
pathf = 'ne/data/ids2017/{}'
fname = 'MachineLearningCSV.zip'
seen_lines = ... | 55.634615 | 192 | 0.601106 |
50cf80c321a8929693133eaee7ef893e49ad2646 | 2,649 | py | Python | listings/views.py | RodrigoMachado9/django | b7c1b6e05af509f264bdb7c5096db4cbcc8efc5f | [
"MIT"
] | 1 | 2019-06-23T00:49:45.000Z | 2019-06-23T00:49:45.000Z | listings/views.py | RodrigoMachado9/django-web | b7c1b6e05af509f264bdb7c5096db4cbcc8efc5f | [
"MIT"
] | 1 | 2019-06-23T00:54:24.000Z | 2019-06-23T00:54:24.000Z | listings/views.py | RodrigoMachado9/django | b7c1b6e05af509f264bdb7c5096db4cbcc8efc5f | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from .models import Listing
from django.core.paginator import Paginator, EmptyPage
from .choices import _price, _states, _bedroom
# Create your views here.
def index(request):
# return render(request, 'listings/listings.jinja2', {
# 'name': 'Machado... | 26.49 | 101 | 0.656852 |
31e8f90f69ba76181419dfe1a9d760c5f596215b | 19,952 | py | Python | sdk/python/pulumi_azure_native/blueprint/assignment.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/blueprint/assignment.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/blueprint/assignment.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 44.835955 | 260 | 0.65422 |
dac9ee1e864aebebfd844c439cb2e66d2d15cf58 | 520 | py | Python | string/0929_unique_email_addresses/0929_unique_email_addresses.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 6 | 2019-09-16T01:50:44.000Z | 2020-09-17T08:52:25.000Z | string/0929_unique_email_addresses/0929_unique_email_addresses.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | null | null | null | string/0929_unique_email_addresses/0929_unique_email_addresses.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 4 | 2020-02-07T12:43:16.000Z | 2021-04-11T06:38:55.000Z | from typing import List
class Solution:
def numUniqueEmails(self, emails: List[str]) -> int:
seen = set()
for email in emails:
local, domain = email.split('@')
if '+' in local:
local = local[:local.index('+')]
seen.add(local.replace('.','') + '@' ... | 30.588235 | 110 | 0.586538 |
cb328d1c27095dd92cc39d4c7215a5a9d6d7a9ad | 2,137 | py | Python | tests/utils/common.py | Radarslan/user-service | 7da0519b75d8889e1afd7d697fbb896f1ab140e7 | [
"MIT"
] | null | null | null | tests/utils/common.py | Radarslan/user-service | 7da0519b75d8889e1afd7d697fbb896f1ab140e7 | [
"MIT"
] | null | null | null | tests/utils/common.py | Radarslan/user-service | 7da0519b75d8889e1afd7d697fbb896f1ab140e7 | [
"MIT"
] | null | null | null | import string
from datetime import datetime
from datetime import timedelta
from random import choices
from random import randint
def get_random_boolean() -> bool:
return bool(randint(0, 1))
def get_random_lower_string(string_length: int) -> str:
return "".join(choices(string.ascii_lowercase, k=string_length... | 26.382716 | 72 | 0.670098 |
ce46be36c88515acfa3b171d8dc08c2a8b02f010 | 264 | py | Python | bitmovin_api_sdk/models/dolby_digital_downmixing_preferred_mode.py | bitmovin/bitmovin-api-sdk-python | 5a85147669c84b8ca411cf2d4dbdddc92d85bbe7 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/models/dolby_digital_downmixing_preferred_mode.py | bitmovin/bitmovin-api-sdk-python | 5a85147669c84b8ca411cf2d4dbdddc92d85bbe7 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/models/dolby_digital_downmixing_preferred_mode.py | bitmovin/bitmovin-api-sdk-python | 5a85147669c84b8ca411cf2d4dbdddc92d85bbe7 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | # coding: utf-8
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
class DolbyDigitalDownmixingPreferredMode(Enum):
LO_RO = "LO_RO"
LT_RT = "LT_RT"
PRO_LOGIC_II = "PRO_LOGIC_II"
| 22 | 59 | 0.772727 |
5efa6a30ed807cf02312d0548f5fcdd2fec52e7f | 98 | py | Python | auditlog/signals.py | armandtvz/django-auditlog | 5b672ab38efd833ec73242784f21a0063b1a31b1 | [
"MIT"
] | null | null | null | auditlog/signals.py | armandtvz/django-auditlog | 5b672ab38efd833ec73242784f21a0063b1a31b1 | [
"MIT"
] | null | null | null | auditlog/signals.py | armandtvz/django-auditlog | 5b672ab38efd833ec73242784f21a0063b1a31b1 | [
"MIT"
] | 1 | 2021-08-31T17:28:25.000Z | 2021-08-31T17:28:25.000Z | from django import dispatch
log_created = dispatch.Signal()
m2m_log_created = dispatch.Signal()
| 16.333333 | 35 | 0.795918 |
6221d70ad05ed6146c9a4f6ff98080401390849e | 353 | py | Python | dgi_customizations/config/docs.py | DigiThinkIT/dgi_customizations | 3a1cfad718cf4e7ff70675a26a0d78d27d26b2bf | [
"MIT"
] | null | null | null | dgi_customizations/config/docs.py | DigiThinkIT/dgi_customizations | 3a1cfad718cf4e7ff70675a26a0d78d27d26b2bf | [
"MIT"
] | null | null | null | dgi_customizations/config/docs.py | DigiThinkIT/dgi_customizations | 3a1cfad718cf4e7ff70675a26a0d78d27d26b2bf | [
"MIT"
] | null | null | null | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/dgi_customizations"
# docs_base_url = "https://[org_name].github.io/dgi_customizations"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_ht... | 29.416667 | 68 | 0.750708 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.