hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a05dba10eba0cd46002ae358afad66ab3fbd5d0 | 16,627 | py | Python | ceasiompy/BalanceUnconventional/func/AinFunc/getdatafromcpacs.py | lverdier1/CEASIOMpy | 178d44b26ba1d9249928823c3896f7ad85d19de8 | [
"Apache-2.0"
] | null | null | null | ceasiompy/BalanceUnconventional/func/AinFunc/getdatafromcpacs.py | lverdier1/CEASIOMpy | 178d44b26ba1d9249928823c3896f7ad85d19de8 | [
"Apache-2.0"
] | null | null | null | ceasiompy/BalanceUnconventional/func/AinFunc/getdatafromcpacs.py | lverdier1/CEASIOMpy | 178d44b26ba1d9249928823c3896f7ad85d19de8 | [
"Apache-2.0"
] | null | null | null | """
CEASIOMpy: Conceptual Aircraft Design Software
Developed for CFS ENGINEERING, 1015 Lausanne, Switzerland
This programm will read the xml file created by the weight module or
the xml file in the cpacs file formatinside the ToolInput folder.
The cpacs file Must contain the:
* maximum_take_off_mass --In.: Maximum... | 41.987374 | 80 | 0.541168 |
4a05dc3d5c7aac5432c75f6e8642483918cb9c71 | 128 | py | Python | modular/Demo02/Collections02.py | walkingtyphoon/Python-workspace | e872bce82b2bac3dd5d809f8576345ccc1c6afb7 | [
"Apache-2.0"
] | null | null | null | modular/Demo02/Collections02.py | walkingtyphoon/Python-workspace | e872bce82b2bac3dd5d809f8576345ccc1c6afb7 | [
"Apache-2.0"
] | null | null | null | modular/Demo02/Collections02.py | walkingtyphoon/Python-workspace | e872bce82b2bac3dd5d809f8576345ccc1c6afb7 | [
"Apache-2.0"
] | null | null | null | from collections import deque
q = deque([1, 2, 3])
print(q)
q.append(6)
print("追加后的元素:", q)
q.appendleft(0)
print("追加后的元素:", q) | 16 | 29 | 0.664063 |
4a05dc8c69da0cb534547666277ceb977a4d720a | 86 | py | Python | components/stairs.py | thomerickson/roguelike | 011a85d53685c922b2b3ddcd28d59818359d15dc | [
"MIT"
] | null | null | null | components/stairs.py | thomerickson/roguelike | 011a85d53685c922b2b3ddcd28d59818359d15dc | [
"MIT"
] | null | null | null | components/stairs.py | thomerickson/roguelike | 011a85d53685c922b2b3ddcd28d59818359d15dc | [
"MIT"
] | null | null | null | # stairs.py
class Stairs():
def __init__(self, floor):
self.floor = floor | 17.2 | 30 | 0.616279 |
4a05dec61c3b0273598334f54da784d2d25e5ccb | 348 | py | Python | scrapinsta/domain/entities/IScrapinsta.py | matheuskolln/scrapinsta | 47ec816f33a36e8570d4c56f921ba18a2d12a306 | [
"MIT"
] | 1 | 2021-09-05T05:37:22.000Z | 2021-09-05T05:37:22.000Z | scrapinsta/domain/entities/IScrapinsta.py | matheuskolln/scrapinsta | 47ec816f33a36e8570d4c56f921ba18a2d12a306 | [
"MIT"
] | 13 | 2020-11-06T17:43:46.000Z | 2021-09-05T00:13:02.000Z | scrapinsta/domain/entities/IScrapinsta.py | matheuskolln/scrapinsta | 47ec816f33a36e8570d4c56f921ba18a2d12a306 | [
"MIT"
] | 2 | 2020-11-09T20:39:57.000Z | 2021-09-05T01:37:29.000Z | from abc import ABC, abstractmethod
from typing import List
class IScrapinsta(ABC):
@abstractmethod
def login(self) -> None:
pass
@abstractmethod
def get_followers(self, user: str, amount: int) -> List[str]:
pass
@abstractmethod
def get_following(self, user: str, amount: int)... | 20.470588 | 65 | 0.646552 |
4a05df9337a4e69d1e8e148cf3341603a392a46b | 1,501 | py | Python | vscode/utils.py | TTitcombe/vscode-ext | 925db8ba809621516722fd1557cc3fd701247497 | [
"MIT"
] | 140 | 2021-07-25T13:54:09.000Z | 2022-02-23T23:52:53.000Z | vscode/utils.py | Nicholas-Schaub/vscode-ext | 3a8b54146e368c67d3e6db7c3929d05e52cbd947 | [
"MIT"
] | 24 | 2021-07-25T14:22:57.000Z | 2022-01-25T01:37:42.000Z | vscode/utils.py | Nicholas-Schaub/vscode-ext | 3a8b54146e368c67d3e6db7c3929d05e52cbd947 | [
"MIT"
] | 19 | 2021-07-25T08:13:36.000Z | 2022-02-12T20:52:04.000Z | from typing import Optional
__all__ = (
"log",
"camel_case_to_snake_case",
"snake_case_to_camel_case",
"snake_case_to_title_case",
"python_condition_to_js_condition",
)
def log(*args, **kwargs):
kwargs["flush"] = True
print(*args, **kwargs)
def camel_case_to_snake_case(t... | 27.796296 | 111 | 0.596935 |
4a05dff28e07fd05c42da14211d72b941f50d4f6 | 650 | py | Python | app/display_modules/pathways/models.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/display_modules/pathways/models.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/display_modules/pathways/models.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | """Models for pathways."""
from app.extensions import mongoDB as mdb
# Define aliases
EmbeddedDoc = mdb.EmbeddedDocumentField # pylint: disable=invalid-name
class PathwaySampleDocument(mdb.EmbeddedDocument): # pylint: disable=too-few-public-methods
"""Pathway for a single sample."""
pathway_abund... | 30.952381 | 92 | 0.747692 |
4a05e069c8cf0c2aff65a77562170fc9441c2403 | 449 | py | Python | processing/file_list.py | ssbgp/data-tools | ec8caf5831eae6a35fd95bb2fb86cf77434bf4d9 | [
"MIT"
] | null | null | null | processing/file_list.py | ssbgp/data-tools | ec8caf5831eae6a35fd95bb2fb86cf77434bf4d9 | [
"MIT"
] | null | null | null | processing/file_list.py | ssbgp/data-tools | ec8caf5831eae6a35fd95bb2fb86cf77434bf4d9 | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Iterator
from collections import Iterable
from processing.file_collection import FileCollection
class FileList(FileCollection):
""" A simple list of files """
def __init__(self, iterable: Iterable) -> None:
self._list = list(iterable)
def __iter__(se... | 24.944444 | 73 | 0.706013 |
4a05e0b1f45dd90a9b2a99a5d94c4d051384ec1c | 392 | py | Python | app/modules.py | yusufsyaifudin/stex | ede1450fa1da296c52353a75f709302bc7bf6f38 | [
"MIT"
] | null | null | null | app/modules.py | yusufsyaifudin/stex | ede1450fa1da296c52353a75f709302bc7bf6f38 | [
"MIT"
] | null | null | null | app/modules.py | yusufsyaifudin/stex | ede1450fa1da296c52353a75f709302bc7bf6f38 | [
"MIT"
] | null | null | null | from flask import render_template
from app import app
# Import a module / component using its blueprint handler variable
from app.home_module.controllers import mod_home
# Register blueprint(s)
# app.register_blueprint(xyz_module)
# ..
app.register_blueprint(mod_home)
# Sample HTTP error handling
@app.errorhandler... | 21.777778 | 66 | 0.790816 |
4a05e1ecee90fe4c8e6643f031c5cfa7dcb965f6 | 932 | py | Python | models/dqn_state.py | abefetterman/slither | fb5a45f40dbc806879caf4e0a758c074ad4d7aca | [
"MIT"
] | null | null | null | models/dqn_state.py | abefetterman/slither | fb5a45f40dbc806879caf4e0a758c074ad4d7aca | [
"MIT"
] | null | null | null | models/dqn_state.py | abefetterman/slither | fb5a45f40dbc806879caf4e0a758c074ad4d7aca | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
import math
from methods.utils import conv_chain
class DQN(nn.Module):
def __init__(self, h, w, batch_norm=False):
super(DQN, self).__init__()
self.conv1 = nn.Conv2d(3, 32, kernel_size=3, stride=1)
self.conv2 = nn.Conv2d(32, 32, kernel_... | 31.066667 | 76 | 0.589056 |
4a05e1f188ae7cd1c99dc41e22303f5c9b66adc1 | 884 | py | Python | tf2_models/utils.py | samiraabnar/DistillingInductiveBias | 962f87e7d38a3d255846432286e048d176ed7a5d | [
"MIT"
] | 10 | 2020-07-04T09:11:36.000Z | 2021-12-16T13:06:35.000Z | tf2_models/utils.py | samiraabnar/DistillingInductiveBias | 962f87e7d38a3d255846432286e048d176ed7a5d | [
"MIT"
] | null | null | null | tf2_models/utils.py | samiraabnar/DistillingInductiveBias | 962f87e7d38a3d255846432286e048d176ed7a5d | [
"MIT"
] | 3 | 2021-07-09T16:24:07.000Z | 2022-02-07T15:49:05.000Z | import tensorflow as tf
import re
from tensorboard.compat.tensorflow_stub import tensor_shape
def camel2snake(name):
return name[0].lower() + re.sub(r'(?!^)[A-Z]', lambda x: '_' + x.group(0).lower(), name[1:])
def log_summary(log_value, log_name, summary_scope):
"""Produce scalar summaries."""
with tf.compat.... | 32.740741 | 99 | 0.692308 |
4a05e2fa26cfc12ddc82be7f8599aa5d4e5546e6 | 1,329 | py | Python | scripts/exponentiation_timing/expm_comparisons.py | Evan1415/QMLA | 4521f7c08456a4494aed7c1b78d8ded5ea40f3d8 | [
"MIT"
] | null | null | null | scripts/exponentiation_timing/expm_comparisons.py | Evan1415/QMLA | 4521f7c08456a4494aed7c1b78d8ded5ea40f3d8 | [
"MIT"
] | null | null | null | scripts/exponentiation_timing/expm_comparisons.py | Evan1415/QMLA | 4521f7c08456a4494aed7c1b78d8ded5ea40f3d8 | [
"MIT"
] | null | null | null | import os as os
import warnings
import numpy as np
import itertools as itr
import matplotlib.pyplot as plt
import sys as sys
import pandas as pd
import warnings
import time as time
import logging
import random
import pickle
pickle.HIGHEST_PROTOCOL = 4
p = os.path.abspath(os.path.realpath(__file__))
elements = p.split(... | 22.525424 | 89 | 0.69526 |
4a05e4d01b698a17f0f01a28150823fd8772b303 | 2,145 | py | Python | src/lib/celery/__init__.py | Jiawei2333/holmuskTest | 46d85619915f977c2ca8e8a431db3c916ac157c7 | [
"MIT"
] | 1 | 2019-08-31T02:19:33.000Z | 2019-08-31T02:19:33.000Z | src/lib/celery/__init__.py | Jiawei2333/holmuskTest | 46d85619915f977c2ca8e8a431db3c916ac157c7 | [
"MIT"
] | 7 | 2020-01-28T22:54:41.000Z | 2022-02-10T00:15:57.000Z | src/lib/celery/__init__.py | kennethleung-holmusk/holmuskTest | 7580f029a06d16a6a319965dd0d1ea466d0c0c64 | [
"MIT"
] | null | null | null | '''library for the celery worker
This contains a library that will generate a celery app. This is
a library that is provided so that everything can be made as
simple as possible. There is no need to change anything in this
library, and this library should work as is. The currelt celery
library works usign an updated ... | 38.303571 | 80 | 0.72028 |
4a05e53a1cb60e71bfce4960cd0a5062bcd88462 | 959 | py | Python | boomerang/client.py | olalidmark/boomerang-client | c4a1d9d96190104b56e10faa78b37ee287929a17 | [
"MIT"
] | null | null | null | boomerang/client.py | olalidmark/boomerang-client | c4a1d9d96190104b56e10faa78b37ee287929a17 | [
"MIT"
] | null | null | null | boomerang/client.py | olalidmark/boomerang-client | c4a1d9d96190104b56e10faa78b37ee287929a17 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import urlparse
import requests
__author__ = 'ola'
class BoomerangClient:
BASE_URL = 'http://api.boomerang.io/v1'
def __init__(self, project_id, api_key):
self.url = "%s/api_key/%s/projects/%s/boomerangs/" % (self.BASE_URL, api_key, project_id)
def boomerang_url(self, b... | 22.833333 | 97 | 0.662148 |
4a05e53bf4ea41ea3099120b9e36a93fab5e0658 | 447 | py | Python | product/migrations/0005_review_date.py | MW982/Django-shop | da28348f93fbe4c545495b7ce43bca7db8f2308b | [
"MIT"
] | null | null | null | product/migrations/0005_review_date.py | MW982/Django-shop | da28348f93fbe4c545495b7ce43bca7db8f2308b | [
"MIT"
] | 7 | 2020-06-06T01:07:24.000Z | 2022-02-10T11:36:55.000Z | product/migrations/0005_review_date.py | MW982/Django-shop | da28348f93fbe4c545495b7ce43bca7db8f2308b | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-09-10 11:37
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
("product", "0004_auto_20190910_1318"),
]
operations = [
migrations.AddField(
model_name="review",
... | 22.35 | 86 | 0.630872 |
4a05e623ab936bb688a75022e7601b42d1d0bf60 | 3,641 | py | Python | huaweicloud-sdk-ivs/huaweicloudsdkivs/v2/model/ivs_extention_by_name_and_id_request_body.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-ivs/huaweicloudsdkivs/v2/model/ivs_extention_by_name_and_id_request_body.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-ivs/huaweicloudsdkivs/v2/model/ivs_extention_by_name_and_id_request_body.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class IvsExtentionByNameAndIdRequestBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map... | 26.772059 | 85 | 0.569898 |
4a05e6a47091e892cbaed95b5add6eb85af36139 | 656 | py | Python | api/drinks/views/uom.py | gthole/drink-stash | 873393fddeaa8f58a8b70d082fbff60175901f97 | [
"MIT"
] | 7 | 2019-03-11T22:43:38.000Z | 2022-02-21T13:18:39.000Z | api/drinks/views/uom.py | gthole/drink-stash | 873393fddeaa8f58a8b70d082fbff60175901f97 | [
"MIT"
] | 62 | 2018-10-13T17:39:07.000Z | 2022-02-26T06:21:41.000Z | api/drinks/views/uom.py | gthole/drink-stash | 873393fddeaa8f58a8b70d082fbff60175901f97 | [
"MIT"
] | 1 | 2020-10-31T16:10:59.000Z | 2020-10-31T16:10:59.000Z | from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from rest_framework.permissions import IsAuthenticated
from drinks.models import Uom
from drinks.serializers import UomSerializer
from drinks.views.base import LazyViewSet
class UomViewSet(LazyViewSet):
audi... | 32.8 | 60 | 0.76372 |
4a05e7dc70bcd875370848e82717b563d83bc601 | 4,126 | py | Python | sbcdb/spectra_utils.py | neilswainston/Grimoire | 42775ff9a03fdbd3b47269b46c883fdf5b37a2be | [
"MIT"
] | 9 | 2019-04-24T12:47:10.000Z | 2021-05-12T12:46:33.000Z | sbcdb/spectra_utils.py | neilswainston/Grimoire | 42775ff9a03fdbd3b47269b46c883fdf5b37a2be | [
"MIT"
] | 1 | 2017-01-16T08:45:19.000Z | 2017-01-16T08:45:19.000Z | sbcdb/spectra_utils.py | synbiochem/biochem4j | 42775ff9a03fdbd3b47269b46c883fdf5b37a2be | [
"MIT"
] | 5 | 2019-10-13T14:02:28.000Z | 2020-12-23T18:44:29.000Z | '''
SYNBIOCHEM-DB (c) University of Manchester 2015
SYNBIOCHEM-DB is licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.
@author: neilswainston
'''
import os
import tempfile
from urllib import urlretrieve
import zipfile
import ijson
__MONA_URL = 'http://mo... | 33.819672 | 76 | 0.601794 |
4a05e830d8a9b6f40ea8a9a41b40e80734cca218 | 6,279 | py | Python | djangocms_blog/forms.py | kapt-labs/djangocms-blog | d18382808766548c0ec1b9f0dabe443d5430aebf | [
"BSD-3-Clause"
] | 1 | 2022-01-09T20:23:10.000Z | 2022-01-09T20:23:10.000Z | djangocms_blog/forms.py | kapt-labs/djangocms-blog | d18382808766548c0ec1b9f0dabe443d5430aebf | [
"BSD-3-Clause"
] | null | null | null | djangocms_blog/forms.py | kapt-labs/djangocms-blog | d18382808766548c0ec1b9f0dabe443d5430aebf | [
"BSD-3-Clause"
] | 1 | 2021-05-26T15:17:13.000Z | 2021-05-26T15:17:13.000Z | from django import forms
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.validators import MaxLengthValidator
from django.utils.functional import cached_property
from parler.forms import TranslatableModelForm
from taggit_autosuggest.widgets import TagAutoSuggest
from .m... | 42.714286 | 118 | 0.675426 |
4a05e8e44751a8c358d2dd267db6c60b64abbabc | 2,903 | py | Python | sync_traccar_erpnext.py | Nayar/frappe-fleet-management-system | 0cea9f5397aa87e7f11eaf6cbe6943b2199b37e6 | [
"MIT"
] | null | null | null | sync_traccar_erpnext.py | Nayar/frappe-fleet-management-system | 0cea9f5397aa87e7f11eaf6cbe6943b2199b37e6 | [
"MIT"
] | null | null | null | sync_traccar_erpnext.py | Nayar/frappe-fleet-management-system | 0cea9f5397aa87e7f11eaf6cbe6943b2199b37e6 | [
"MIT"
] | 3 | 2019-09-09T17:18:37.000Z | 2020-09-15T14:34:25.000Z | import http.client
from base64 import b64encode
import json
class Settings:
traccar_server='10.65.35.27:8082'
erpnext_server='10.65.35.117:8000'
traccar_auth_header={ 'Authorization' : 'Basic %s' % (b64encode(b"admin:admin").decode("ascii")) }
erpnext_headers = False
class MeraFrappeHelper:
def curl():
... | 34.559524 | 173 | 0.67413 |
4a05e9a36bf772824d1148b769f5b914ca430f3d | 9,323 | py | Python | kedro/extras/datasets/pandas/parquet_dataset.py | austospumanto/kedro | 4f89c8fd32c6660affa5ff7d4fe2b096d5de9c95 | [
"Apache-2.0"
] | null | null | null | kedro/extras/datasets/pandas/parquet_dataset.py | austospumanto/kedro | 4f89c8fd32c6660affa5ff7d4fe2b096d5de9c95 | [
"Apache-2.0"
] | null | null | null | kedro/extras/datasets/pandas/parquet_dataset.py | austospumanto/kedro | 4f89c8fd32c6660affa5ff7d4fe2b096d5de9c95 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 QuantumBlack Visual Analytics 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 40.890351 | 134 | 0.644642 |
4a05e9c86052bb44d80b048c87a4d4415d10cc4b | 705 | py | Python | djact/apps/authentication/serializers.py | baoooliang/ColleegeApp | 1030cf3af34f8a98ca88327511956e7289c85fe4 | [
"MIT"
] | 9 | 2020-08-28T08:27:18.000Z | 2022-03-27T12:54:28.000Z | djact/apps/authentication/serializers.py | baoooliang/ColleegeApp | 1030cf3af34f8a98ca88327511956e7289c85fe4 | [
"MIT"
] | 5 | 2020-08-05T18:38:07.000Z | 2022-02-28T15:53:04.000Z | djact/apps/authentication/serializers.py | baoooliang/ColleegeApp | 1030cf3af34f8a98ca88327511956e7289c85fe4 | [
"MIT"
] | 7 | 2020-08-10T17:28:07.000Z | 2021-07-07T15:01:13.000Z | from rest_framework import serializers
from .models import User
class UserSerializer(serializers.ModelSerializer):
email = serializers.EmailField(required=True)
username = serializers.CharField()
password = serializers.CharField(min_length=8, write_only=True)
class Meta:
model = User
... | 28.2 | 67 | 0.666667 |
4a05eaa125af0c2c385fbe7c9dcd329ba86fadf3 | 267 | py | Python | codeEval/medium/overlapping_rectangles.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | codeEval/medium/overlapping_rectangles.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | codeEval/medium/overlapping_rectangles.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | import sys
def overlap(ls):
if max(ls[0], ls[4]) > min(ls[2], ls[6]) or max(ls[3], ls[7]) > min(ls[1], ls[5]):
return False
return True
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
print overlap(map(int, test.split(",")))
test_cases.close() | 24.272727 | 84 | 0.621723 |
4a05eabb29b4b4f0d46a3dfcaddbd1880f14746e | 20,799 | py | Python | reference/django-survey/survey/views.py | FiaDot/programmer-competency-matrix | c44a328e9b51ab9ade1e36798dfff50741d74ae5 | [
"MIT"
] | 2 | 2018-03-11T22:46:12.000Z | 2018-03-13T01:30:08.000Z | reference/django-survey/survey/views.py | FiaDot/programmer-competency-matrix | c44a328e9b51ab9ade1e36798dfff50741d74ae5 | [
"MIT"
] | null | null | null | reference/django-survey/survey/views.py | FiaDot/programmer-competency-matrix | c44a328e9b51ab9ade1e36798dfff50741d74ae5 | [
"MIT"
] | null | null | null | from datetime import datetime
import os
from django.db import models
from django.db.models import Q
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import redirect_... | 44.253191 | 121 | 0.60926 |
4a05eb3f34e6f5cf2523239c05d9ce4ebb1b0b5d | 199,126 | py | Python | python/cudf/cudf/tests/test_dataframe.py | marlenezw/cudf | f6e14facc37fa270d302a8e1c39abffb6675c53e | [
"Apache-2.0"
] | 1 | 2021-03-01T05:41:41.000Z | 2021-03-01T05:41:41.000Z | python/cudf/cudf/tests/test_dataframe.py | marlenezw/cudf | f6e14facc37fa270d302a8e1c39abffb6675c53e | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_dataframe.py | marlenezw/cudf | f6e14facc37fa270d302a8e1c39abffb6675c53e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018-2020, NVIDIA CORPORATION.
import array as arr
import io
import operator
import random
import re
import textwrap
import cupy
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
from numba import cuda
import cudf as gd
from cudf.core.column import column
from cudf.core.datafra... | 28.634743 | 79 | 0.547287 |
4a05ec7469ebc8bab4e637bf0a4cd9f50029cd13 | 269 | py | Python | os_scrapy_rq_crawler/__init__.py | zanachka/os-scrapy-rq-crawler | f861f5633b90ce4e2c3a5488a14ed77b1c40d7af | [
"MIT"
] | 3 | 2020-05-13T12:55:03.000Z | 2021-03-15T10:09:12.000Z | os_scrapy_rq_crawler/__init__.py | zanachka/os-scrapy-rq-crawler | f861f5633b90ce4e2c3a5488a14ed77b1c40d7af | [
"MIT"
] | null | null | null | os_scrapy_rq_crawler/__init__.py | zanachka/os-scrapy-rq-crawler | f861f5633b90ce4e2c3a5488a14ed77b1c40d7af | [
"MIT"
] | 1 | 2020-10-29T18:15:25.000Z | 2020-10-29T18:15:25.000Z | from .asyncio.rq import AsyncRequestQueue
from .upstream import MultiUpstreamRequestQueue
from .utils import HTTPRequestQueue, MemoryRequestQueue
__all__ = [
"MemoryRequestQueue",
"AsyncRequestQueue",
"HTTPRequestQueue",
"MultiUpstreamRequestQueue",
]
| 24.454545 | 55 | 0.784387 |
4a05ecb0dfd4dab6e0d0f2ea82a8fe1f5f558c6f | 758 | py | Python | Setup.py | linard-y/pySolanio | 3bbb689ee7b9ccfca6ea52f99f84263dd03b1045 | [
"MIT"
] | null | null | null | Setup.py | linard-y/pySolanio | 3bbb689ee7b9ccfca6ea52f99f84263dd03b1045 | [
"MIT"
] | null | null | null | Setup.py | linard-y/pySolanio | 3bbb689ee7b9ccfca6ea52f99f84263dd03b1045 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import pySolanio
setup(
name='pySolanio',
version=pySolanio.__version__,
packages=find_packages(),
author="Linard Y.",
author_email="yldev@free.fr",
description="Solution analysis input/output",
long_description=open('README.md').... | 21.055556 | 49 | 0.627968 |
4a05ed6ae9de38ebef33b780fbce89622cc49d69 | 6,797 | py | Python | salt/modules/win_service.py | moniker-dns/salt | 0e1cd880dc7831b9f937a213dd90cc32e2a09884 | [
"Apache-2.0"
] | 1 | 2016-03-13T09:05:15.000Z | 2016-03-13T09:05:15.000Z | salt/modules/win_service.py | moniker-dns/salt | 0e1cd880dc7831b9f937a213dd90cc32e2a09884 | [
"Apache-2.0"
] | null | null | null | salt/modules/win_service.py | moniker-dns/salt | 0e1cd880dc7831b9f937a213dd90cc32e2a09884 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Windows Service module.
'''
# Import python libs
import time
import salt.utils
def __virtual__():
'''
Only works on Windows systems
'''
if salt.utils.is_windows():
return 'service'
return False
def get_enabled():
'''
Return the enabled services
C... | 22.885522 | 89 | 0.576872 |
4a05edb6c0bca8e76cd51c3be4bdfd6230c29623 | 39,981 | py | Python | week/migrations/0001_initial.py | uno-isqa-8950/fitgirl-inc | 2656e7340e85ab8cbeb0de19dcbc81030b9b5b81 | [
"MIT"
] | 6 | 2018-09-11T15:30:10.000Z | 2020-01-14T17:29:07.000Z | week/migrations/0001_initial.py | uno-isqa-8950/fitgirl-inc | 2656e7340e85ab8cbeb0de19dcbc81030b9b5b81 | [
"MIT"
] | 722 | 2018-08-29T17:27:38.000Z | 2022-03-11T23:28:33.000Z | week/migrations/0001_initial.py | uno-isqa-8950/fitgirl-inc | 2656e7340e85ab8cbeb0de19dcbc81030b9b5b81 | [
"MIT"
] | 13 | 2018-08-29T07:42:01.000Z | 2019-04-21T22:34:30.000Z | # Generated by Django 2.2.4 on 2020-05-03 17:02
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.core.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('w... | 63.461905 | 449 | 0.602586 |
4a05edbb09bf4e5a77939b0ec51765a45de8b739 | 2,529 | py | Python | tensorflow_probability/python/bijectors/softsign.py | m-colombo/probability | 74037f90010c08e17a567c281ff3f70f4157364a | [
"Apache-2.0"
] | 1 | 2018-09-15T05:02:30.000Z | 2018-09-15T05:02:30.000Z | tensorflow_probability/python/bijectors/softsign.py | snehil03july/probability | 5f576230f1e261a823e20a49c442ff38c8f381d3 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/softsign.py | snehil03july/probability | 5f576230f1e261a823e20a49c442ff38c8f381d3 | [
"Apache-2.0"
] | 1 | 2019-10-13T19:52:57.000Z | 2019-10-13T19:52:57.000Z | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 28.738636 | 78 | 0.642151 |
4a05ee9ddfedf06c42ef4d8cb985400a44472736 | 4,757 | py | Python | tests/util.py | questdb/pykit | c8aac35ab57b88d422f40126380f11f1d1e2d143 | [
"Apache-2.0"
] | 7 | 2021-10-04T12:28:17.000Z | 2022-01-13T16:41:47.000Z | tests/util.py | questdb/pykit | c8aac35ab57b88d422f40126380f11f1d1e2d143 | [
"Apache-2.0"
] | null | null | null | tests/util.py | questdb/pykit | c8aac35ab57b88d422f40126380f11f1d1e2d143 | [
"Apache-2.0"
] | 1 | 2022-02-10T05:53:24.000Z | 2022-02-10T05:53:24.000Z | #
# ___ _ ____ ____
# / _ \ _ _ ___ ___| |_| _ \| __ )
# | | | | | | |/ _ \/ __| __| | | | _ \
# | |_| | |_| | __/\__ \ |_| |_| | |_) |
# \__\_\\__,_|\___||___/\__|____/|____/
#
# Copyright (c) 2014-2019 Appsicle
# Copyright (c) 2019-2020 QuestDB
#
# Licensed under the Apache... | 35.237037 | 109 | 0.622031 |
4a05ef7b8a5251310d48536430191c6293e4faa7 | 4,577 | py | Python | gn/compile_sksl_tests.py | borodust/skia | bbbf1a7f50a303bd76163793bd5968c72f5f4432 | [
"BSD-3-Clause"
] | null | null | null | gn/compile_sksl_tests.py | borodust/skia | bbbf1a7f50a303bd76163793bd5968c72f5f4432 | [
"BSD-3-Clause"
] | null | null | null | gn/compile_sksl_tests.py | borodust/skia | bbbf1a7f50a303bd76163793bd5968c72f5f4432 | [
"BSD-3-Clause"
] | 1 | 2021-06-06T21:31:52.000Z | 2021-06-06T21:31:52.000Z | #!/usr/bin/env python
#
# Copyright 2020 Google LLC
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shlex
import subprocess
import sys
import tempfile
batchCompile = True
skslc = sys.argv[1]
lang = sys.argv[2]
settings = sys.argv[3]
with open(s... | 34.413534 | 98 | 0.626393 |
4a05f012a3c41cbd4cedd528f8e799f99b9f7fed | 35,825 | py | Python | src/auto-posture-evaluator/testers/vpc_tester.py | antstackio/coralogix-aws-serverless | 00d49bc8bb22d2ec466d68a3d77d967d6ead5fa8 | [
"Apache-2.0"
] | null | null | null | src/auto-posture-evaluator/testers/vpc_tester.py | antstackio/coralogix-aws-serverless | 00d49bc8bb22d2ec466d68a3d77d967d6ead5fa8 | [
"Apache-2.0"
] | null | null | null | src/auto-posture-evaluator/testers/vpc_tester.py | antstackio/coralogix-aws-serverless | 00d49bc8bb22d2ec466d68a3d77d967d6ead5fa8 | [
"Apache-2.0"
] | null | null | null | import time
import boto3
import interfaces
import json
def _format_string_to_json(text):
return json.loads(text)
class Tester(interfaces.TesterInterface):
def __init__(self):
self.aws_vpc_client = boto3.client('ec2')
self.cache = {}
self.user_id = boto3.client('sts').get_caller_ident... | 52.223032 | 120 | 0.588193 |
4a05f13866efb2e81f652438cd856acad4f0f1e0 | 1,866 | py | Python | react_new.py | megapod/create-react-web-app-from-cache | 41457e29a4d6acdfc8cae408917de589e35d8145 | [
"MIT"
] | null | null | null | react_new.py | megapod/create-react-web-app-from-cache | 41457e29a4d6acdfc8cae408917de589e35d8145 | [
"MIT"
] | null | null | null | react_new.py | megapod/create-react-web-app-from-cache | 41457e29a4d6acdfc8cae408917de589e35d8145 | [
"MIT"
] | null | null | null | import subprocess
import os
import sys
# if a project name was passed as a cli argument.
if len(sys.argv) > 1:
# extract the template to the new project directory
try:
subprocess.run(
["7z", "x", "react_project_template.7z", "-o./" + sys.argv[1]],
stderr=subprocess.DEVNULL, stdo... | 29.15625 | 79 | 0.691854 |
4a05f1a51a603bb275f191c85025605717ffa6fa | 10,531 | py | Python | bin/wgc/quota.py | orionzhou/nf | cb56f9b17c7c9352e34a3d89c8c38b777085a057 | [
"MIT"
] | null | null | null | bin/wgc/quota.py | orionzhou/nf | cb56f9b17c7c9352e34a3d89c8c38b777085a057 | [
"MIT"
] | null | null | null | bin/wgc/quota.py | orionzhou/nf | cb56f9b17c7c9352e34a3d89c8c38b777085a057 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Quota synteny alignment (QUOTA-ALIGN)
%prog [options] anchorsfile --qbed=qbedfile --sbed=sbedfile
This python program does the following:
1. merge 2D-overlapping blocks (now skipped, but existed in original version)
2. build constraints that represent 1D-overlap among ... | 28.852055 | 88 | 0.600608 |
4a05f1c1b4025f03075abd9ec1d4d3ace24a66ec | 1,775 | py | Python | test/appendixA/test_dFBT.py | omelchert/dFBT-FJ | 31ba7b2733558ad3096fa0de689407a22bbda5e8 | [
"BSD-3-Clause"
] | 1 | 2020-12-16T10:58:25.000Z | 2020-12-16T10:58:25.000Z | test/appendixA/test_dFBT.py | omelchert/dFBT-FJ | 31ba7b2733558ad3096fa0de689407a22bbda5e8 | [
"BSD-3-Clause"
] | null | null | null | test/appendixA/test_dFBT.py | omelchert/dFBT-FJ | 31ba7b2733558ad3096fa0de689407a22bbda5e8 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import dFBT
import scipy.special as scs
import numpy as np
def FBPair():
f = lambda r: np.exp(-r*r/4/np.pi)
F0 = lambda r: np.exp(-r*r*np.pi)*2*np.pi
return f, F0
def eRMS(Fn,Fx):
return np.sqrt(((Fn-Fx)**2).mean()/(Fx*Fx).mean())
class FourierBesselTransformTestCase(unittes... | 29.098361 | 75 | 0.591549 |
4a05f1ca1ef669ad3006a53f2b09e833ffd0c47c | 1,430 | py | Python | workflow/notebooks/analysis/scripts/imports.py | CambridgeSemiticsLab/BH_time_collocations | 2d1864b6e9cd26624c769ee1e970d69d19da7fbf | [
"CC-BY-4.0"
] | 5 | 2019-06-19T19:42:21.000Z | 2021-04-20T22:43:45.000Z | workflow/notebooks/analysis/scripts/imports.py | CambridgeSemiticsLab/BHTenseAndAspect | 2d1864b6e9cd26624c769ee1e970d69d19da7fbf | [
"CC-BY-4.0"
] | 2 | 2020-02-25T10:19:40.000Z | 2020-03-13T15:29:01.000Z | workflow/notebooks/analysis/scripts/imports.py | CambridgeSemiticsLab/BHTenseAndAspect | 2d1864b6e9cd26624c769ee1e970d69d19da7fbf | [
"CC-BY-4.0"
] | null | null | null | """
Standard imports for the analysis notebooks.
"""
import re
import json
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
pd.set_option('display.max_rows', 200)
idx = pd.IndexSlice
from adjustText import adjust_text
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition... | 25.535714 | 64 | 0.731469 |
4a05f2046d838c38e363d8c7f5389e6438f1b560 | 10,045 | py | Python | process/LidarAutoCalibration.py | sameeptandon/sail-car-log | 0ee3d598bb09d389bcbd2ebf73cd4b2411e796be | [
"BSD-2-Clause"
] | 1 | 2021-02-24T03:11:13.000Z | 2021-02-24T03:11:13.000Z | process/LidarAutoCalibration.py | sameeptandon/sail-car-log | 0ee3d598bb09d389bcbd2ebf73cd4b2411e796be | [
"BSD-2-Clause"
] | null | null | null | process/LidarAutoCalibration.py | sameeptandon/sail-car-log | 0ee3d598bb09d389bcbd2ebf73cd4b2411e796be | [
"BSD-2-Clause"
] | 3 | 2015-03-18T14:36:04.000Z | 2018-07-04T02:57:24.000Z | from LidarTransforms import *
import sys, os
from VideoReader import *
import cv2
from cv2 import imshow, waitKey
from numpy.linalg import norm
from ColorMap import *
from numpy import exp, log, sqrt
from transformations import euler_matrix
import scipy.weave
import itertools
from ArgParser import *
def computeDista... | 29.544118 | 95 | 0.534793 |
4a05f4ad6d27ff369daa090e737e5c9ca3268ba9 | 9,631 | py | Python | modules/graph_age_params.py | enflujo/COVID_schools_dashboard | 702c9c3c91938e514e56f4cf6f325ed954d7bc3e | [
"Apache-2.0"
] | null | null | null | modules/graph_age_params.py | enflujo/COVID_schools_dashboard | 702c9c3c91938e514e56f4cf6f325ed954d7bc3e | [
"Apache-2.0"
] | null | null | null | modules/graph_age_params.py | enflujo/COVID_schools_dashboard | 702c9c3c91938e514e56f4cf6f325ed954d7bc3e | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np2
def build(args):
# Get medians
def get_medians(df_p, last):
df_res = df_p.iloc[-last:].groupby(["param"]).median().reset_index()["median"][0]
return df_res
def medians_params(df_list, age_group, last):
params_def = ["age", "beta", "IFR", "Re... | 49.137755 | 120 | 0.692555 |
4a05f4d2a6c88116db4d09a27db737b1ba69ded3 | 78 | py | Python | plugins/rapid7_tcell/komand_rapid7_tcell/actions/list_inline_scripts/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/rapid7_tcell/komand_rapid7_tcell/actions/list_inline_scripts/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/rapid7_tcell/komand_rapid7_tcell/actions/list_inline_scripts/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .action import ListInlineScripts
| 26 | 39 | 0.794872 |
4a05f55cc3d1dda1d8422d44ce69cad96b69b695 | 9,159 | py | Python | cloudflare/tests/unit/test__hook.py | DriesSchulten/dehydrated-pi | 5700b736f60b47a729538b5515728d14f1c58d57 | [
"MIT"
] | 1 | 2022-02-23T16:25:48.000Z | 2022-02-23T16:25:48.000Z | cloudflare/tests/unit/test__hook.py | DriesSchulten/dehydrated-pi | 5700b736f60b47a729538b5515728d14f1c58d57 | [
"MIT"
] | null | null | null | cloudflare/tests/unit/test__hook.py | DriesSchulten/dehydrated-pi | 5700b736f60b47a729538b5515728d14f1c58d57 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import json
import os
import re
import tempfile
import mock
import requests_mock
from six.moves.urllib import parse as urlparse
import testtools
# Se... | 29.737013 | 79 | 0.554318 |
4a05f67f820c17453193e913343b790ebd144787 | 3,409 | py | Python | bin/MSVC-Setup.py | antonelloceravola/ToolBOSCore | b03414a867a9f0585e06bb8e4f299c4be1357f3a | [
"BSD-3-Clause"
] | null | null | null | bin/MSVC-Setup.py | antonelloceravola/ToolBOSCore | b03414a867a9f0585e06bb8e4f299c4be1357f3a | [
"BSD-3-Clause"
] | null | null | null | bin/MSVC-Setup.py | antonelloceravola/ToolBOSCore | b03414a867a9f0585e06bb8e4f299c4be1357f3a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Configures the user's shell environment to use MSVC (with Wine)
#
# Copyright (c) Honda Research Institute Europe GmbH
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# ... | 34.434343 | 77 | 0.622177 |
4a05f6880a67b163e419871abffe6de9f36489c9 | 5,903 | py | Python | tensorflow_probability/python/distributions/chi.py | cafeal/probability | f968a32d601d29ec31a10568ccfe30263cf91ef2 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/chi.py | cafeal/probability | f968a32d601d29ec31a10568ccfe30263cf91ef2 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/chi.py | cafeal/probability | f968a32d601d29ec31a10568ccfe30263cf91ef2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.438272 | 80 | 0.682026 |
4a05f6945c2575980830ca1c491b7e1b2f6004b6 | 1,596 | py | Python | rocketgram/keyboards/reply.py | waneroy/rocketgram | b84d12772a743a534878e417cd8c1f3c7d4ace1f | [
"MIT"
] | null | null | null | rocketgram/keyboards/reply.py | waneroy/rocketgram | b84d12772a743a534878e417cd8c1f3c7d4ace1f | [
"MIT"
] | null | null | null | rocketgram/keyboards/reply.py | waneroy/rocketgram | b84d12772a743a534878e417cd8c1f3c7d4ace1f | [
"MIT"
] | 1 | 2021-02-26T14:21:59.000Z | 2021-02-26T14:21:59.000Z | # Copyright (C) 2015-2019 by Vd.
# This file is part of RocketGram, the modern Telegram bot framework.
# RocketGram is released under the MIT License (see LICENSE).
from .keyboard import Keyboard
class ReplyKeyboard(Keyboard):
def __init__(self, *, selective=False, one_time=False, resize=False):
super()... | 30.692308 | 73 | 0.635965 |
4a05f6e2e824f4c68af9351af34d058ab8702266 | 11,740 | py | Python | exe/db_petit-saut.py | Tristanovsk/trios | d84a498f0b562d7a792a4588e4d983be885f24b9 | [
"MIT"
] | null | null | null | exe/db_petit-saut.py | Tristanovsk/trios | d84a498f0b562d7a792a4588e4d983be885f24b9 | [
"MIT"
] | null | null | null | exe/db_petit-saut.py | Tristanovsk/trios | d84a498f0b562d7a792a4588e4d983be885f24b9 | [
"MIT"
] | null | null | null | import glob
import re
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 18})
from scipy.interpolate import interp1d
import pyodbc
import fiona
import pandas as pd
import pandas_access as pda
import geopandas as gpd
fiona.drvsupport.supported_drivers['kml'] = 'rw' # enable ... | 41.338028 | 121 | 0.538671 |
4a05f73f6b7ace0e28c57cbe3b21760a41918c8b | 1,258 | py | Python | app/models.py | UMCUGenetics/illumina-runinfo | 48c451fe034670c9b15289f6f94226757147941d | [
"MIT"
] | 1 | 2018-06-18T16:23:08.000Z | 2018-06-18T16:23:08.000Z | app/models.py | UMCUGenetics/illumina-runinfo | 48c451fe034670c9b15289f6f94226757147941d | [
"MIT"
] | null | null | null | app/models.py | UMCUGenetics/illumina-runinfo | 48c451fe034670c9b15289f6f94226757147941d | [
"MIT"
] | 1 | 2021-02-10T13:45:45.000Z | 2021-02-10T13:45:45.000Z | from app import db
class RunInfo(db.Model):
## Required
id = db.Column(db.Integer, primary_key=True)
run_id = db.Column(db.String(50), nullable=False, unique=True)
experiment_name = db.Column(db.String(100), nullable=False)
run_start_date = db.Column(db.Date, nullable=False)
barcode = db.Column... | 34.944444 | 94 | 0.682035 |
4a05f860cc7ff28ad07d992d289994698550398a | 9,879 | py | Python | tg_bot/functions.py | EeOneDown/spbu4u | 2ad01088fb167c80c53b757a0247fc5cde34c20f | [
"Apache-2.0"
] | 30 | 2017-09-14T20:25:43.000Z | 2022-03-12T09:55:35.000Z | tg_bot/functions.py | EeOneDown/spbu4u | 2ad01088fb167c80c53b757a0247fc5cde34c20f | [
"Apache-2.0"
] | 59 | 2018-01-12T18:29:24.000Z | 2019-03-08T21:08:40.000Z | tg_bot/functions.py | EeOneDown/spbu4u | 2ad01088fb167c80c53b757a0247fc5cde34c20f | [
"Apache-2.0"
] | 8 | 2017-12-01T18:36:04.000Z | 2020-11-22T00:36:15.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from datetime import datetime, date, timedelta
import pymysql
import spbu
from app.constants import emoji, subject_short_types
server_timedelta = timedelta(hours=0)
def parse_event_time(event):
return "{0} {1:0>2}:{2:0>2}{3}{4:0>2}:{... | 33.716724 | 79 | 0.551675 |
4a05f8dc94cf74888fc19e7d9d1ea25746586951 | 1,933 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/__init__.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/__init__.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/__init__.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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 may ... | 37.901961 | 94 | 0.691671 |
4a05fa517e7c5b3e5eb0ae582b36d2c7b4d9e1a1 | 855 | py | Python | tests/test_data.py | mikemhenry/pyscreener | 9894eaac59a8648c55e834e061c31daa85fb74bd | [
"MIT"
] | 34 | 2021-01-08T00:32:01.000Z | 2022-02-20T20:02:55.000Z | tests/test_data.py | mikemhenry/pyscreener | 9894eaac59a8648c55e834e061c31daa85fb74bd | [
"MIT"
] | 24 | 2021-01-29T18:28:45.000Z | 2022-03-22T21:48:01.000Z | tests/test_data.py | mikemhenry/pyscreener | 9894eaac59a8648c55e834e061c31daa85fb74bd | [
"MIT"
] | 13 | 2021-01-09T11:07:03.000Z | 2022-02-10T23:08:11.000Z | import random
import uuid
import pytest
from pyscreener.docking import CalculationData, Result
from pyscreener.exceptions import InvalidResultError, NotSimulatedError
@pytest.fixture(
params=["CCCCCCC", "C1CCC1", "CC(=O)CC", "CCCCCCCC", "CCCC1CC1"]
)
def smi(request):
return request.param
def test_notsimul... | 25.909091 | 71 | 0.708772 |
4a05fb3796e881a1620c454a358c17b5b4abb745 | 3,217 | py | Python | backend/migrations/0002_auto_20190814_1719.py | animeshk08/voting-ethereum | 60c8e97a7bd5124cda295237d7b6919b3bb1f9b7 | [
"MIT"
] | null | null | null | backend/migrations/0002_auto_20190814_1719.py | animeshk08/voting-ethereum | 60c8e97a7bd5124cda295237d7b6919b3bb1f9b7 | [
"MIT"
] | 6 | 2021-03-19T11:44:10.000Z | 2021-05-11T19:18:34.000Z | backend/migrations/0002_auto_20190814_1719.py | animeshk08/voting-ethereum | 60c8e97a7bd5124cda295237d7b6919b3bb1f9b7 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-08-14 17:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='AadharDetail',
... | 41.24359 | 128 | 0.565434 |
4a05fbf1070daad181d215f558e8cb4f14cf7efa | 23,335 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_azure_firewalls_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_azure_firewalls_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_azure_firewalls_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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 may ... | 48.21281 | 197 | 0.659567 |
4a05fcc1af80d1bf00710e4fa64fabcf5c7f6780 | 9,567 | py | Python | regression/efas/boxplot_reg.py | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 41 | 2018-12-07T23:10:50.000Z | 2022-02-19T03:01:49.000Z | regression/efas/boxplot_reg.py | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 59 | 2019-01-04T15:43:30.000Z | 2022-03-31T09:48:15.000Z | regression/efas/boxplot_reg.py | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2019-01-07T14:36:33.000Z | 2021-09-06T14:48:36.000Z | # (C) Copyright 1996-2016 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergov... | 28.72973 | 86 | 0.618062 |
4a05fdb4d1902a1a453a65b732fcef322fbc5c00 | 5,844 | py | Python | planemo/lint.py | TMiguelT/planemo | deccc48cb15ea9e670f1dbbc0d6dd1e96fe96418 | [
"CC-BY-3.0"
] | null | null | null | planemo/lint.py | TMiguelT/planemo | deccc48cb15ea9e670f1dbbc0d6dd1e96fe96418 | [
"CC-BY-3.0"
] | null | null | null | planemo/lint.py | TMiguelT/planemo | deccc48cb15ea9e670f1dbbc0d6dd1e96fe96418 | [
"CC-BY-3.0"
] | null | null | null | """Utilities to help linting various targets."""
from __future__ import absolute_import
import os
import requests
from galaxy.tool_util.lint import LintContext
from six.moves.urllib.request import urlopen
import planemo.linters.biocontainer_registered
import planemo.linters.conda_requirements
import planemo.linters.... | 32.648045 | 147 | 0.636721 |
4a06002baa15e09aa4e8731bb03e95e0b8385d23 | 893 | py | Python | tests/unit/test_models/test_submodels/test_external_circuit/test_function_control.py | danieljtait/PyBaMM | f9d6143770e4a01099f06e3574142424730f731a | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_models/test_submodels/test_external_circuit/test_function_control.py | danieljtait/PyBaMM | f9d6143770e4a01099f06e3574142424730f731a | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_models/test_submodels/test_external_circuit/test_function_control.py | danieljtait/PyBaMM | f9d6143770e4a01099f06e3574142424730f731a | [
"BSD-3-Clause"
] | null | null | null | #
# Test function control submodel
#
import pybamm
import tests
import unittest
def external_circuit_function(variables):
I = variables["Current [A]"]
V = variables["Terminal voltage [V]"]
return V + I - pybamm.FunctionParameter("Current plus voltage function", pybamm.t)
class TestFunctionControl(unitte... | 26.264706 | 86 | 0.68981 |
4a06002e3484652559a2192c44b953a2233ab840 | 1,463 | py | Python | setup.py | iPlantCollaborativeOpenSource/rfive | 6a50bfe9c646f23b4dfde7e7bbda2381f33552af | [
"BSD-3-Clause"
] | null | null | null | setup.py | iPlantCollaborativeOpenSource/rfive | 6a50bfe9c646f23b4dfde7e7bbda2381f33552af | [
"BSD-3-Clause"
] | null | null | null | setup.py | iPlantCollaborativeOpenSource/rfive | 6a50bfe9c646f23b4dfde7e7bbda2381f33552af | [
"BSD-3-Clause"
] | 2 | 2019-12-04T22:35:59.000Z | 2019-12-11T22:37:02.000Z | import os
import setuptools
from rfive.version import get_version
readme = open('README.md').read()
long_description = """
rfive %s
A unified interface into multiple cloud providers.
To install use pip install git+git://git@github.com:iPlantCollaborativeOpenSource/rfive.git
----
%s
----
For more information, ple... | 29.857143 | 91 | 0.683527 |
4a0601bd18a7344cd3e88615f713f901a87bc362 | 4,213 | py | Python | Examples/Example_6/run.py | mrslezak/Engine | c46ff278a2c5f4162db91a7ab500a0bb8cef7657 | [
"BSD-3-Clause"
] | 335 | 2016-10-07T16:31:10.000Z | 2022-03-02T07:12:03.000Z | Examples/Example_6/run.py | mrslezak/Engine | c46ff278a2c5f4162db91a7ab500a0bb8cef7657 | [
"BSD-3-Clause"
] | 59 | 2016-10-31T04:20:24.000Z | 2022-01-03T16:39:57.000Z | Examples/Example_6/run.py | mrslezak/Engine | c46ff278a2c5f4162db91a7ab500a0bb8cef7657 | [
"BSD-3-Clause"
] | 180 | 2016-10-08T14:23:50.000Z | 2022-03-28T10:43:05.000Z | #!/usr/bin/env python
import sys
import os
sys.path.append('../')
from ore_examples_helper import OreExample
oreex = OreExample(sys.argv[1] if len(sys.argv)>1 else False)
# Portfolio 1 run
oreex.print_headline("Run ORE to produce NPV cube and exposures for portfolio 1")
oreex.run("Input/ore_portfolio_1.xml")
oreex.g... | 50.759036 | 143 | 0.745075 |
4a06042c989cba7437d95ac442d69d1549bd29e1 | 12,632 | py | Python | analysis/interaction_analysis_all_dbs.py | broncio123/mpmodeling | 4910d6fc8822fd7358edeca1ed2e57383ec5bc35 | [
"MIT"
] | null | null | null | analysis/interaction_analysis_all_dbs.py | broncio123/mpmodeling | 4910d6fc8822fd7358edeca1ed2e57383ec5bc35 | [
"MIT"
] | null | null | null | analysis/interaction_analysis_all_dbs.py | broncio123/mpmodeling | 4910d6fc8822fd7358edeca1ed2e57383ec5bc35 | [
"MIT"
] | null | null | null | import os
import sys
import numpy
import pandas as pd
import json
import subprocess
import isambard_dev
import operator
import matplotlib.pyplot as plt
plt.switch_backend('agg')
from operator import itemgetter
import seaborn as sns
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
##########... | 34.326087 | 116 | 0.584706 |
4a06049b9c90d256cd4b76da3077eb6a2675fdcc | 2,401 | py | Python | ramp-frontend/ramp_frontend/tests/test_utils.py | frcaud/ramp-board | 3df90e51a4faeb0c03bab5dc13e12311807a618e | [
"BSD-3-Clause"
] | 13 | 2019-02-16T22:30:11.000Z | 2021-01-11T10:13:47.000Z | ramp-frontend/ramp_frontend/tests/test_utils.py | frcaud/ramp-board | 3df90e51a4faeb0c03bab5dc13e12311807a618e | [
"BSD-3-Clause"
] | 427 | 2018-11-22T22:01:47.000Z | 2022-03-15T17:35:57.000Z | ramp-frontend/ramp_frontend/tests/test_utils.py | frcaud/ramp-board | 3df90e51a4faeb0c03bab5dc13e12311807a618e | [
"BSD-3-Clause"
] | 18 | 2018-11-22T16:22:18.000Z | 2021-12-07T14:42:41.000Z | import shutil
import pytest
from ramp_utils import generate_flask_config
from ramp_utils import read_config
from ramp_utils.testing import database_config_template
from ramp_utils.testing import ramp_config_template
from ramp_database.model import Model
from ramp_database.testing import create_toy_db
from ramp_datab... | 31.592105 | 72 | 0.700541 |
4a0604b3e522eb57e403b23823c3ab7432552069 | 4,861 | py | Python | async_limits/storage/memory.py | anomit/limits | a02d3234664d2b4da9968fd5ad25899ce106517a | [
"MIT"
] | 1 | 2021-06-21T13:51:56.000Z | 2021-06-21T13:51:56.000Z | async_limits/storage/memory.py | anomit/limits | a02d3234664d2b4da9968fd5ad25899ce106517a | [
"MIT"
] | null | null | null | async_limits/storage/memory.py | anomit/limits | a02d3234664d2b4da9968fd5ad25899ce106517a | [
"MIT"
] | null | null | null | import threading
import time
from collections import Counter
from .base import Storage
class LockableEntry(threading._RLock):
__slots__ = ["atime", "expiry"]
def __init__(self, expiry):
self.atime = time.time()
self.expiry = self.atime + expiry
super(LockableEntry, self).__init__()
... | 31.771242 | 76 | 0.575396 |
4a0605b04f9c93869d9a94979c835c3987fbaccb | 1,929 | py | Python | django/contrib/gis/db/backends/oracle/adapter.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/contrib/gis/db/backends/oracle/adapter.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/contrib/gis/db/backends/oracle/adapter.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | from cx_Oracle import CLOB
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.geos import GeometryCollection, Polygon
class OracleSpatialAdapter(WKTAdapter):
input_size = CLOB
def __init__(self, geom):
"""
Oracle requires that polygon rings ... | 33.258621 | 75 | 0.587869 |
4a06071390e7618760ca6bac7689a3cad3e9ad9d | 28,467 | py | Python | qiskit/aqua/quantum_instance.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 504 | 2018-12-15T16:34:03.000Z | 2022-03-26T11:24:53.000Z | qiskit/aqua/quantum_instance.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 746 | 2018-12-16T16:44:42.000Z | 2021-07-10T16:59:43.000Z | qiskit/aqua/quantum_instance.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 421 | 2018-12-22T14:49:00.000Z | 2022-03-04T09:47:07.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 46.287805 | 102 | 0.597745 |
4a0607ae66550506dccafaa1d750e5ae53d907a2 | 12,827 | py | Python | catamount/tests/full/tf_word2vec.py | jthestness/catamount | 9de3090f1a02a04774f28a0d10f677a76f50446f | [
"Apache-2.0"
] | null | null | null | catamount/tests/full/tf_word2vec.py | jthestness/catamount | 9de3090f1a02a04774f28a0d10f677a76f50446f | [
"Apache-2.0"
] | 2 | 2021-05-18T20:31:42.000Z | 2021-05-18T20:43:43.000Z | catamount/tests/full/tf_word2vec.py | jthestness/catamount | 9de3090f1a02a04774f28a0d10f677a76f50446f | [
"Apache-2.0"
] | null | null | null | import argparse
import numpy as np
import pickle
import re
import sympy
import sys
sys.setrecursionlimit(50000)
from catamount.api import utils
import catamount.frameworks.tensorflow
from catamount.ops.constant import *
from catamount.ops.unknown_op import UnknownOp
from catamount.ops.variable import *
is_pytest_run... | 43.043624 | 402 | 0.682701 |
4a06095a9535022895b7813a89fd0c87995d6625 | 5,697 | py | Python | edu/class3/vit_answer.py | h1063135843/PaddleViT | 6f150b82d801b082cc7af09af396bfe2f6bf9987 | [
"Apache-2.0"
] | 1 | 2021-12-12T12:34:01.000Z | 2021-12-12T12:34:01.000Z | edu/class3/vit_answer.py | h1063135843/PaddleViT | 6f150b82d801b082cc7af09af396bfe2f6bf9987 | [
"Apache-2.0"
] | null | null | null | edu/class3/vit_answer.py | h1063135843/PaddleViT | 6f150b82d801b082cc7af09af396bfe2f6bf9987 | [
"Apache-2.0"
] | null | null | null | # ViT Online Class
# Author: Dr. Zhu
# Project: PaddleViT (https:///github.com/BR-IDL/PaddleViT)
# 2021.11
import copy
import paddle
import paddle.nn as nn
class Identity(nn.Layer):
def __init__(self):
super().__init__()
def forward(self, x):
return x
class Mlp(nn.Layer):
def __init__(s... | 29.518135 | 115 | 0.560821 |
4a060a5fe19d83183ca65dc405df06de0aec0fc6 | 798 | py | Python | timesketch/lib/analyzers/sigma_tagger_test.py | dmdicki/timesketch | f0ae4230a88edbe62aa0ad1ce74b7dda844df731 | [
"Apache-2.0"
] | 1 | 2020-03-06T18:20:53.000Z | 2020-03-06T18:20:53.000Z | timesketch/lib/analyzers/sigma_tagger_test.py | dmdicki/timesketch | f0ae4230a88edbe62aa0ad1ce74b7dda844df731 | [
"Apache-2.0"
] | null | null | null | timesketch/lib/analyzers/sigma_tagger_test.py | dmdicki/timesketch | f0ae4230a88edbe62aa0ad1ce74b7dda844df731 | [
"Apache-2.0"
] | 1 | 2021-11-16T00:01:18.000Z | 2021-11-16T00:01:18.000Z | """Tests for SigmaPlugin."""
from __future__ import unicode_literals
import mock
from timesketch.lib.analyzers import sigma_tagger
from timesketch.lib.testlib import BaseTest
from timesketch.lib.testlib import MockDataStore
class TestSigmaPlugin(BaseTest):
"""Tests the functionality of the analyzer."""
def... | 27.517241 | 68 | 0.705514 |
4a060a8d352289575fd1cc751e41166c3de46ade | 6,470 | py | Python | src/main.py | MayD524/May-s-2D-Adventure | 4038b1f2fcbddca9ae526fc7ba5e3e3a98d65a7a | [
"MIT"
] | null | null | null | src/main.py | MayD524/May-s-2D-Adventure | 4038b1f2fcbddca9ae526fc7ba5e3e3a98d65a7a | [
"MIT"
] | null | null | null | src/main.py | MayD524/May-s-2D-Adventure | 4038b1f2fcbddca9ae526fc7ba5e3e3a98d65a7a | [
"MIT"
] | null | null | null | from game_files.projectile import mayProjectile
from game_files.gameHandler import GameHandler
from game_files.collectables import *
from game_files.gameConsts import *
from game_files.floor import mayFloor
from game_files.player import player
from game_files.npc import mayNPC
import pyxel
import json
class ... | 36.145251 | 142 | 0.510819 |
4a060b631c8c4a94a492929f476c36d24069d91e | 15,479 | py | Python | tardis/plasma/base.py | bartnikm/tardis-bartnikm | 2b0f3110fefd6740349ca7b33fe72bf025c88452 | [
"BSD-3-Clause"
] | null | null | null | tardis/plasma/base.py | bartnikm/tardis-bartnikm | 2b0f3110fefd6740349ca7b33fe72bf025c88452 | [
"BSD-3-Clause"
] | null | null | null | tardis/plasma/base.py | bartnikm/tardis-bartnikm | 2b0f3110fefd6740349ca7b33fe72bf025c88452 | [
"BSD-3-Clause"
] | null | null | null | import os
import re
import logging
import tempfile
import fileinput
import networkx as nx
from tardis.plasma.exceptions import PlasmaMissingModule, NotInitializedModule
from tardis.plasma.properties.base import *
from tardis.io.util import PlasmaWriterMixin
logger = logging.getLogger(__name__)
class BasePlasma(Pla... | 34.551339 | 80 | 0.520964 |
4a060be1d633c688810302c28abf45c39d401eb0 | 2,016 | py | Python | src/federator-draft/test_federator_metrics.py | TaoHaoTian/federated-recommender-system | 65a151238e1a419fc713d26fa11ecfe4536d94ee | [
"MIT"
] | 3 | 2020-10-18T13:45:33.000Z | 2021-12-14T13:01:52.000Z | src/federator-draft/test_federator_metrics.py | TaoHaoTian/federated-recommender-system | 65a151238e1a419fc713d26fa11ecfe4536d94ee | [
"MIT"
] | 1 | 2019-09-23T22:08:57.000Z | 2019-09-23T22:08:57.000Z | src/federator-draft/test_federator_metrics.py | TaoHaoTian/federated-recommender-system | 65a151238e1a419fc713d26fa11ecfe4536d94ee | [
"MIT"
] | 2 | 2020-09-08T08:18:03.000Z | 2021-02-22T02:53:25.000Z | from lightfm_alg import LightFMAlg
from surprise_svd import SurpriseSVD
from data_handler import DataHandler
from definitions import ROOT_DIR
import helpers
import matplotlib.pyplot as plt
def test_alg_times():
dh = DataHandler(filename=ROOT_DIR + "/datasets/ml-25m/ratings.csv")
dh.dataset = dh.sort_dataset_... | 32.516129 | 105 | 0.679563 |
4a060cce92c56f3c8f8a4e3dc340246bff20659b | 66,516 | py | Python | cinder/tests/unit/volume/drivers/test_nfs.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/drivers/test_nfs.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | 2 | 2018-10-25T13:04:01.000Z | 2019-08-17T13:15:24.000Z | cinder/tests/unit/volume/drivers/test_nfs.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | 2 | 2018-10-17T13:32:50.000Z | 2018-11-08T08:39:39.000Z | # Copyright (c) 2012 NetApp, 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... | 41.520599 | 79 | 0.620843 |
4a060e12fdc1396a0acd0d193d5623143bef1605 | 29,684 | py | Python | setup.py | sagarjadhav1456/pygame | 7d3900d5b04dc8102f218cc60f3fbf5e06dd8fa1 | [
"Python-2.0",
"OLDAP-2.3"
] | 2 | 2021-04-03T20:01:35.000Z | 2021-09-09T23:42:21.000Z | setup.py | sagarjadhav1456/pygame | 7d3900d5b04dc8102f218cc60f3fbf5e06dd8fa1 | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | setup.py | sagarjadhav1456/pygame | 7d3900d5b04dc8102f218cc60f3fbf5e06dd8fa1 | [
"Python-2.0",
"OLDAP-2.3"
] | 1 | 2020-10-31T11:32:34.000Z | 2020-10-31T11:32:34.000Z | #!/usr/bin/env python
#
# This is the distutils setup script for pygame.
# Full instructions are in https://www.pygame.org/wiki/GettingStarted
#
# To configure, compile, install, just run this script.
# python setup.py install
DESCRIPTION = """Pygame is a Python wrapper module for the
SDL multimedia library. It co... | 35.850242 | 109 | 0.583681 |
4a060f0c75f66abe18e471a6b7e2ccdaaba062c3 | 37,665 | py | Python | venv1/Lib/site-packages/tensorflow/contrib/eager/python/checkpointable_utils.py | Soum-Soum/Tensorflow_Face_Finder | fec6c15d2df7012608511ad87f4b55731bf99478 | [
"Apache-2.0",
"MIT"
] | null | null | null | venv1/Lib/site-packages/tensorflow/contrib/eager/python/checkpointable_utils.py | Soum-Soum/Tensorflow_Face_Finder | fec6c15d2df7012608511ad87f4b55731bf99478 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-05-20T00:58:04.000Z | 2021-05-20T00:58:04.000Z | venv1/Lib/site-packages/tensorflow/contrib/eager/python/checkpointable_utils.py | Soum-Soum/Tensorflow_Face_Finder | fec6c15d2df7012608511ad87f4b55731bf99478 | [
"Apache-2.0",
"MIT"
] | null | null | null | """Utilities for working with Checkpointable objects."""
# Copyright 2017 The TensorFlow 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://ww... | 42.801136 | 117 | 0.711881 |
4a0611ba960682f9f602f3ce36035e3958c86894 | 538 | py | Python | doc/scripts/runtime_hook_subclass.py | jvail/xarray-simlab | 3e8cb81775868e3e7c6495489ba351567e0d7e42 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 48 | 2017-06-19T16:31:37.000Z | 2021-04-26T04:42:48.000Z | doc/scripts/runtime_hook_subclass.py | rlange2/xarray-simlab | 45359e99cbf6341464b02cb937618c051a58a31c | [
"BSD-3-Clause"
] | 108 | 2017-06-26T12:22:10.000Z | 2021-03-09T08:57:02.000Z | doc/scripts/runtime_hook_subclass.py | rlange2/xarray-simlab | 45359e99cbf6341464b02cb937618c051a58a31c | [
"BSD-3-Clause"
] | 10 | 2017-08-11T04:56:20.000Z | 2021-03-01T16:46:55.000Z | # TODO: use sphinx ipython directive when issue fixed
# https://github.com/ipython/ipython/issues/11362
import xsimlab as xs
import time
class PrintStepTime(xs.RuntimeHook):
@xs.runtime_hook("run_step", "model", "pre")
def start_step(self, model, context, state):
self._start_time = time.time()
... | 28.315789 | 69 | 0.684015 |
4a0611cbda4cb32530996863dd77a0a08ac658d6 | 7,530 | py | Python | cohesity_management_sdk/models/vmware_restore_parameters.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | 1 | 2021-01-07T20:36:22.000Z | 2021-01-07T20:36:22.000Z | cohesity_management_sdk/models/vmware_restore_parameters.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | cohesity_management_sdk/models/vmware_restore_parameters.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
import cohesity_management_sdk.models.network_mapping
class VmwareRestoreParameters(object):
"""Implementation of the 'VmwareRestoreParameters' model.
Specifies the information required for recovering or cloning VmWare VMs.
Attributes:
data... | 46.770186 | 129 | 0.65166 |
4a0611e36fa01a0e4ed61083842a0fdecae06e93 | 476 | py | Python | lists.py | jplusplus/goodiebag | 8f8f26719220fe69efd42edf4a1309e522146d41 | [
"0BSD"
] | null | null | null | lists.py | jplusplus/goodiebag | 8f8f26719220fe69efd42edf4a1309e522146d41 | [
"0BSD"
] | null | null | null | lists.py | jplusplus/goodiebag | 8f8f26719220fe69efd42edf4a1309e522146d41 | [
"0BSD"
] | 2 | 2015-10-19T08:16:02.000Z | 2020-10-19T08:22:48.000Z | # -*- coding: utf-8 -*-
def get_unique(list_):
"""Returnerar en lista där varje värde bara förekommer
en gång.
"""
return list(set(list_))
def flatten_list(list_):
""" Returnerar en endimensionell lista [a, b, c, d, e],
givet en tvådimensionell [[a, b], [c], [d, e]]
"""
return [inn... | 20.695652 | 59 | 0.556723 |
4a06123eacb453444ef363610c58daf3ff7e762e | 776 | py | Python | send2trash/win/__init__.py | hsoft/send2trash | be402728fb7f5f889961d38ca10648ac97379845 | [
"BSD-3-Clause"
] | 147 | 2015-01-06T07:08:43.000Z | 2020-05-20T12:52:01.000Z | send2trash/win/__init__.py | hsoft/send2trash | be402728fb7f5f889961d38ca10648ac97379845 | [
"BSD-3-Clause"
] | 43 | 2015-06-04T15:39:16.000Z | 2020-06-03T17:05:31.000Z | send2trash/win/__init__.py | hsoft/send2trash | be402728fb7f5f889961d38ca10648ac97379845 | [
"BSD-3-Clause"
] | 32 | 2015-03-24T08:27:15.000Z | 2020-05-21T16:20:16.000Z | # Copyright 2017 Virgil Dupras
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
from __future__ import unicode_literals
from platform import version
# i... | 36.952381 | 87 | 0.743557 |
4a06127c59d0df4084773b6f7559d54908474033 | 1,884 | py | Python | Projects/calc.py | SanjanaSogimatt/Python | a84b94aadd599eb189bf637eebd7f0db703d798d | [
"MIT"
] | 12 | 2021-01-18T16:22:27.000Z | 2021-11-30T04:38:27.000Z | Projects/calc.py | SanjanaSogimatt/Python | a84b94aadd599eb189bf637eebd7f0db703d798d | [
"MIT"
] | 31 | 2021-03-02T16:33:16.000Z | 2022-03-30T04:01:15.000Z | Projects/calc.py | SanjanaSogimatt/Python | a84b94aadd599eb189bf637eebd7f0db703d798d | [
"MIT"
] | 31 | 2021-03-02T14:26:17.000Z | 2022-01-30T16:51:08.000Z | # calculator function - which when called will function as a calculator
def calculator():
print("Options:\n\t[1] Add \n\t[2] Subtract \n\t[3] Multiply \n\t[4] Divide \n\t[5] Power \n\t[6] Square root")
ch = int(input("\t--> ")) # take option input from user
#addition
if ch == 1:
num1 = flo... | 31.4 | 115 | 0.508493 |
4a0612bb5b044dabde8552cba901dc29f29b24bf | 1,404 | py | Python | quotespage/urls.py | Cornell-CIS-Slack/cs-quotes | a4451ff0703acebb762641cbc236cc0e51e2d2fd | [
"BSD-3-Clause"
] | 1 | 2017-10-04T16:16:22.000Z | 2017-10-04T16:16:22.000Z | quotespage/urls.py | Cornell-CIS-Slack/cs-quotes | a4451ff0703acebb762641cbc236cc0e51e2d2fd | [
"BSD-3-Clause"
] | null | null | null | quotespage/urls.py | Cornell-CIS-Slack/cs-quotes | a4451ff0703acebb762641cbc236cc0e51e2d2fd | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path, re_path
from django.views.generic import TemplateView
from quotespage import views
app_name='quotespage'
urlpatterns = [
path('', views.index, name='index'),
path('submit/', views.submit, name='submit'),
path('speakers/', views.speaker_list, name='speaker-list'),
re_path(r'^spea... | 50.142857 | 109 | 0.687322 |
4a0612f4dcf19768617230233b7da3c0e42249f2 | 92,428 | py | Python | nltk/downloader.py | PhanatosZou/nltk | 750e488569b6f80c72ae6ca74eff90eae55e6c4e | [
"Apache-2.0"
] | null | null | null | nltk/downloader.py | PhanatosZou/nltk | 750e488569b6f80c72ae6ca74eff90eae55e6c4e | [
"Apache-2.0"
] | null | null | null | nltk/downloader.py | PhanatosZou/nltk | 750e488569b6f80c72ae6ca74eff90eae55e6c4e | [
"Apache-2.0"
] | null | null | null | # Natural Language Toolkit: Corpus & Model Downloader
#
# Copyright (C) 2001-2019 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
The NLTK corpus and module downloader. This module defines several
interfaces which can be used to download... | 36.260494 | 88 | 0.55217 |
4a06151399105912117de07d65803a53ec84bb93 | 32,563 | py | Python | qe_reader.py | Paul-St-Young/solid_hydrogen | dd218cd431a283dc1a371a0af5696074d63b8c6c | [
"MIT"
] | 2 | 2020-08-13T23:32:03.000Z | 2021-03-28T01:14:06.000Z | qe_reader.py | Paul-St-Young/solid_hydrogen | dd218cd431a283dc1a371a0af5696074d63b8c6c | [
"MIT"
] | null | null | null | qe_reader.py | Paul-St-Young/solid_hydrogen | dd218cd431a283dc1a371a0af5696074d63b8c6c | [
"MIT"
] | null | null | null | import numpy as np
from mmap import mmap
from qharv.reel.ascii_out import read, name_sep_val, all_lines_with_tag
def read_first_energy(scf_out):
with open(scf_out,'r+') as f:
mm = mmap(f.fileno(),0)
# end with
idx = mm.find(b'!')
mm.seek(idx)
eline = mm.readline().decode()
energy = flo... | 28.944889 | 154 | 0.604336 |
4a0619a07b5229fe16c99b58078c5eed1379b83d | 3,038 | py | Python | server/djangoapp/models.py | jalsop24/agfzb-CloudAppDevelopment_Capstone | 494670b518f7dfe397700afd7f251b70287ee053 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/models.py | jalsop24/agfzb-CloudAppDevelopment_Capstone | 494670b518f7dfe397700afd7f251b70287ee053 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/models.py | jalsop24/agfzb-CloudAppDevelopment_Capstone | 494670b518f7dfe397700afd7f251b70287ee053 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.utils.timezone import now
# Create your models here.
# <HINT> Create a Car Make model `class CarMake(models.Model)`:
# - Name
# - Description
# - Any other fields you would like to include in car make model
# - __str__ method to print a car make object
class CarMake(models.Mo... | 29.211538 | 126 | 0.625741 |
4a061a659a16348cbc7b00e61595deccbac0a3a8 | 189 | py | Python | data_collection/gazette/spiders/sc_jupia.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 454 | 2018-04-07T03:32:57.000Z | 2020-08-17T19:56:22.000Z | data_collection/gazette/spiders/sc_jupia.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 254 | 2020-08-18T14:09:43.000Z | 2022-03-28T11:30:51.000Z | data_collection/gazette/spiders/sc_jupia.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 183 | 2018-04-11T15:09:37.000Z | 2020-08-15T18:55:11.000Z | from gazette.spiders.base.fecam import FecamGazetteSpider
class ScJupiaSpider(FecamGazetteSpider):
name = "sc_jupia"
FECAM_QUERY = "cod_entidade:143"
TERRITORY_ID = "4209177"
| 23.625 | 57 | 0.761905 |
4a061b31351d9122b46f42c91c2fdde07f5a4de0 | 12,947 | py | Python | src/ezdxf/entitydb.py | jpsantos-mf/ezdxf | 2b542a551b2cfc3c0920a5dbf302ff58cea90fbd | [
"MIT"
] | 1 | 2021-06-05T09:15:15.000Z | 2021-06-05T09:15:15.000Z | src/ezdxf/entitydb.py | jpsantos-mf/ezdxf | 2b542a551b2cfc3c0920a5dbf302ff58cea90fbd | [
"MIT"
] | null | null | null | src/ezdxf/entitydb.py | jpsantos-mf/ezdxf | 2b542a551b2cfc3c0920a5dbf302ff58cea90fbd | [
"MIT"
] | null | null | null | # Copyright (c) 2019-2020, Manfred Moitzi
# License: MIT License
from typing import Optional, Iterable, Tuple, TYPE_CHECKING, Dict, Set
from contextlib import contextmanager
from ezdxf.tools.handle import HandleGenerator
from ezdxf.lldxf.types import is_valid_handle
from ezdxf.entities.dxfentity import DXFEntity
from e... | 36.573446 | 83 | 0.599985 |
4a061b45912558814f2153090319c78d49b082d4 | 3,673 | py | Python | nbgrader/apps/listapp.py | aliniknejad/nbgrader | 124095e48a840ac2af6e3178eab7ed32089f3cd2 | [
"BSD-3-Clause"
] | 1 | 2019-10-02T11:06:32.000Z | 2019-10-02T11:06:32.000Z | nbgrader/apps/listapp.py | aliniknejad/nbgrader | 124095e48a840ac2af6e3178eab7ed32089f3cd2 | [
"BSD-3-Clause"
] | 4 | 2019-03-02T11:49:46.000Z | 2020-09-07T10:17:52.000Z | nbgrader/apps/listapp.py | aliniknejad/nbgrader | 124095e48a840ac2af6e3178eab7ed32089f3cd2 | [
"BSD-3-Clause"
] | 2 | 2019-05-31T08:53:48.000Z | 2019-05-31T09:42:26.000Z | # coding: utf-8
from traitlets import default
from .baseapp import NbGrader, nbgrader_aliases, nbgrader_flags
from ..exchange import Exchange, ExchangeList, ExchangeError
aliases = {}
aliases.update(nbgrader_aliases)
aliases.update({
"timezone": "Exchange.timezone",
"course": "CourseDirectory.course_id",
})... | 28.695313 | 84 | 0.604138 |
4a061bf6978a578c27d3169cde197363cfdfc223 | 2,939 | py | Python | 100dayspython/day003/main.py | mrqssjeff/project-python | b3b08f2acfe825640a5ee92cf9d6fa45ab580384 | [
"MIT"
] | null | null | null | 100dayspython/day003/main.py | mrqssjeff/project-python | b3b08f2acfe825640a5ee92cf9d6fa45ab580384 | [
"MIT"
] | null | null | null | 100dayspython/day003/main.py | mrqssjeff/project-python | b3b08f2acfe825640a5ee92cf9d6fa45ab580384 | [
"MIT"
] | null | null | null | print('''
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠤⠒⠊⠉⠉⠓⠒⠒⠒⠢⢤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠔⠊⠁⠀⠀⠀⠀⠀⠀⠀⢀⠰⡄⠠⡀⠈⠓⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢀⡔⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠣⢣⠀⠹⡀⢣⠀⠱⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣠⠋⠀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠀⢱⠀⡇⢠⠁⡀⢱⡄⠘⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣰⠃⠀⠀⡞⠆⢠⠀⠀⠀⢀⣠⣤⣴⣶⣾⣿⣿⣶⣷⣾⣦⣧⣸⡟⠀⠘⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣸⠃⠀⠀⠀⠁⡀⠈⣦⣴⣾⣿⣿⣿⣿⣿⡿⠿⠟⠛⠛⠋⠉⠉⠉⢉⡍⠉⠉⠓⠒⠠⠤⠀⡤⠒⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢀⡇... | 43.865672 | 116 | 0.303505 |
4a061d548a5345a7d1cd70081c8acfd1cb7c8bd2 | 6,802 | py | Python | tests/test_accounts.py | kullo/server | 0ad28a9bf50346e654fcbf709d55c74bb48c98c7 | [
"BSD-3-Clause"
] | 1 | 2021-06-15T07:47:54.000Z | 2021-06-15T07:47:54.000Z | tests/test_accounts.py | kullo/server | 0ad28a9bf50346e654fcbf709d55c74bb48c98c7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_accounts.py | kullo/server | 0ad28a9bf50346e654fcbf709d55c74bb48c98c7 | [
"BSD-3-Clause"
] | null | null | null | # vim: set expandtab shiftwidth=4 :
# pylint: disable=missing-docstring
import json
import requests
from . import base
from . import db
from . import settings
def make_body(user):
return {
'address': user['address'],
'loginKey': user['loginKey'],
'privateDataKey': user['privateDataKey'],
... | 35.8 | 76 | 0.661276 |
4a061d80ad25b36712618e4a697833d1550b8fd9 | 78,652 | py | Python | pymc3/sampling.py | Sooner0931/pymc3 | 875efa0d3bb4ef682b736f92816a75fc378d5a6e | [
"Apache-2.0"
] | 1 | 2020-09-05T05:52:09.000Z | 2020-09-05T05:52:09.000Z | pymc3/sampling.py | pgerramirez/pymc3 | 458e513e47ed764c1ec4efcfce50ea7bd9fefbfd | [
"Apache-2.0"
] | null | null | null | pymc3/sampling.py | pgerramirez/pymc3 | 458e513e47ed764c1ec4efcfce50ea7bd9fefbfd | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The PyMC Developers
#
# 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 ag... | 36.804867 | 134 | 0.622921 |
4a061e32da2df005310843b42da0ecb2fed7b711 | 6,146 | py | Python | tests/unit/bokeh/server/test_util.py | Suicoleiro/bokeh | a212acdf091a7a4df639fa9d443be6ade0018039 | [
"BSD-3-Clause"
] | 15,193 | 2015-01-01T05:11:45.000Z | 2022-03-31T19:30:20.000Z | tests/unit/bokeh/server/test_util.py | Suicoleiro/bokeh | a212acdf091a7a4df639fa9d443be6ade0018039 | [
"BSD-3-Clause"
] | 9,554 | 2015-01-01T03:16:54.000Z | 2022-03-31T22:59:39.000Z | tests/unit/bokeh/server/test_util.py | Suicoleiro/bokeh | a212acdf091a7a4df639fa9d443be6ade0018039 | [
"BSD-3-Clause"
] | 4,829 | 2015-01-02T03:35:32.000Z | 2022-03-30T16:40:26.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 44.861314 | 81 | 0.52587 |
4a061e874cefe709928978e63644b9bea854685c | 521 | py | Python | examples/alias_startup.py | rpavani1998/cmd2 | 77d9015986bca909aae9181e2d72d0d835aeaa09 | [
"MIT"
] | null | null | null | examples/alias_startup.py | rpavani1998/cmd2 | 77d9015986bca909aae9181e2d72d0d835aeaa09 | [
"MIT"
] | null | null | null | examples/alias_startup.py | rpavani1998/cmd2 | 77d9015986bca909aae9181e2d72d0d835aeaa09 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
"""A simple example demonstrating the following:
1) How to add custom command aliases using the alias command
2) How to load an initialization script at startup
"""
import cmd2
class AliasAndStartup(cmd2.Cmd):
""" Example cmd2 application where we create commands that ... | 26.05 | 112 | 0.710173 |
4a061f7139033bbae2e12a8c1a7e9c889dcc0bd8 | 7,195 | py | Python | tracpro/polls/tests/test_views.py | rapidpro/tracpro | a68a782a7ff9bb0ccee85368132d8847c280fea3 | [
"BSD-3-Clause"
] | 5 | 2015-07-21T15:58:31.000Z | 2019-09-14T22:34:00.000Z | tracpro/polls/tests/test_views.py | rapidpro/tracpro | a68a782a7ff9bb0ccee85368132d8847c280fea3 | [
"BSD-3-Clause"
] | 197 | 2015-03-24T15:26:04.000Z | 2017-11-28T19:24:37.000Z | tracpro/polls/tests/test_views.py | rapidpro/tracpro | a68a782a7ff9bb0ccee85368132d8847c280fea3 | [
"BSD-3-Clause"
] | 10 | 2015-03-24T12:26:36.000Z | 2017-02-21T13:08:57.000Z | # coding=utf-8
from __future__ import absolute_import, unicode_literals
import csv
import datetime
from StringIO import StringIO
import pytz
from django.core.urlresolvers import reverse
from tracpro.test.cases import TracProDataTest
from ..models import Response
from . import factories
class PollCRUDLTest(TracPr... | 40.195531 | 120 | 0.576233 |
4a061f9322b9e372c4baf60148a42dc6736985f0 | 6,066 | py | Python | kart/__init__.py | giacomocaironi/Kart | 29db924c69e679a19c508a5e41cc3ef3689e1a71 | [
"MIT"
] | 3 | 2020-03-24T17:02:20.000Z | 2021-07-21T11:01:06.000Z | kart/__init__.py | giacomocaironi/Kart | 29db924c69e679a19c508a5e41cc3ef3689e1a71 | [
"MIT"
] | 2 | 2020-09-13T16:18:29.000Z | 2021-03-21T14:43:00.000Z | kart/__init__.py | giacomocaironi/Kart | 29db924c69e679a19c508a5e41cc3ef3689e1a71 | [
"MIT"
] | null | null | null | import argparse
import fnmatch
import shutil
import threading
import traceback
from copy import deepcopy
from http.server import HTTPServer
from pathlib import Path
from kart.utils import KartMap, KartObserver, KartRequestHandler, merge_dicts
class Kart:
"""Main Kart class"""
def __init__(
self,
... | 34.078652 | 102 | 0.576162 |
4a06206d8c8943ba6035bf4bd97e05a4bf6fe76b | 2,349 | py | Python | nets/autoencoder.py | mepittma/bmi203-final | ef60d91cafbd3372f13917aa67102ec8f19e7ee8 | [
"Apache-2.0"
] | null | null | null | nets/autoencoder.py | mepittma/bmi203-final | ef60d91cafbd3372f13917aa67102ec8f19e7ee8 | [
"Apache-2.0"
] | null | null | null | nets/autoencoder.py | mepittma/bmi203-final | ef60d91cafbd3372f13917aa67102ec8f19e7ee8 | [
"Apache-2.0"
] | null | null | null | # Implement an 8x3x8 autoencoder. This neural network should take a matrix
# input and returns the same matrix as an output.
# First, represent the neural network as a list of layers, where each layer in
# the network is represented as a class with a weight matrix, bias vector,
# activation function, function's deriva... | 30.115385 | 100 | 0.642401 |
4a06207ba60a7a4e5903af22eab19cfa826554ab | 9,749 | py | Python | commands.py | ShruthiChari/whyis | fcfb6a205c637eaf738babfbfac0bc537c6379bc | [
"Apache-2.0"
] | null | null | null | commands.py | ShruthiChari/whyis | fcfb6a205c637eaf738babfbfac0bc537c6379bc | [
"Apache-2.0"
] | null | null | null | commands.py | ShruthiChari/whyis | fcfb6a205c637eaf738babfbfac0bc537c6379bc | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from flask_script import Command, Option, prompt_bool
from flask_security.utils import encrypt_password, verify_password, get_hmac
import flask
from base64 import b64encode
import os
import datetime
import rdflib
from nanopub import Nanopublication
from cookiecutter.main import cookiecutter
... | 38.231373 | 110 | 0.582008 |
4a0620a471a216f68190b6fab3267d48495239ae | 5,219 | py | Python | spark_auto_mapper_fhir/backbone_elements/implementation_guide_resource.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/backbone_elements/implementation_guide_resource.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/backbone_elements/implementation_guide_resource.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from typing import Optional, TYPE_CHECKING
from spark_auto_mapper_fhir.fhir_types.boolean import FhirBoolean
from spark_auto_mapper_fhir.fhir_types.list import FhirList
from spark_auto_mapper_fhir.fhir_types.string import FhirString
from spark_auto_mapper_fhir.extensions.extension_ba... | 48.324074 | 288 | 0.720253 |
4a0620b81f4861f68faf121bb247ba73e4fcf275 | 74,104 | py | Python | venv/lib/python3.8/site-packages/vsts/gallery/v4_0/gallery_client.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/gallery/v4_0/gallery_client.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/gallery/v4_0/gallery_client.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 53.776488 | 355 | 0.606418 |
4a062249caf6cf0bdd282a1a8bed382beb55f317 | 610 | py | Python | iwant/core/engine/monitor/callbacks.py | nirvik/iWant | 503b7289cac4056cb20cc156b746370def5e8e04 | [
"MIT"
] | 323 | 2017-06-24T09:31:52.000Z | 2022-02-25T03:10:00.000Z | iwant/core/engine/monitor/callbacks.py | crypticterminal/iWant | 503b7289cac4056cb20cc156b746370def5e8e04 | [
"MIT"
] | 7 | 2017-06-29T12:44:34.000Z | 2021-06-04T23:37:19.000Z | iwant/core/engine/monitor/callbacks.py | crypticterminal/iWant | 503b7289cac4056cb20cc156b746370def5e8e04 | [
"MIT"
] | 28 | 2017-06-30T01:10:04.000Z | 2021-03-10T02:38:44.000Z | from iwant.core.protocols import FilemonitorClientFactory
from iwant.core.config import SERVER_DAEMON_HOST, SERVER_DAEMON_PORT
from twisted.internet import reactor
from iwant.core.constants import INDEXED, FILE_SYS_EVENT
def filechangeCB(updates):
if len(updates['ADD']) != 0 or len(updates['DEL']) != 0:
f... | 38.125 | 75 | 0.793443 |
4a06225b63aaf9906a84ad77df97e4e6bd7f55d3 | 4,567 | py | Python | qa/rpc-tests/netutil.py | TrueDividendCrypto/truecrypto-oss | d6dda1a4f467b772cccece1b3915d3e391e9809f | [
"MIT"
] | null | null | null | qa/rpc-tests/netutil.py | TrueDividendCrypto/truecrypto-oss | d6dda1a4f467b772cccece1b3915d3e391e9809f | [
"MIT"
] | null | null | null | qa/rpc-tests/netutil.py | TrueDividendCrypto/truecrypto-oss | d6dda1a4f467b772cccece1b3915d3e391e9809f | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2019 The Bitcoin Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Linux network utilities
import sys
import socket
import fcntl
import struct
import array
import os
impo... | 32.621429 | 113 | 0.599956 |
4a0622a55249a81bccc64f18a69cc77c6fe70d69 | 2,196 | py | Python | toyClassification/SGHMC-64/datasets.py | nicolasrosa-forks/evaluating_bdl | 2973b0d018551de0c9f087e2ae4e6b2c22f2ce3c | [
"MIT"
] | null | null | null | toyClassification/SGHMC-64/datasets.py | nicolasrosa-forks/evaluating_bdl | 2973b0d018551de0c9f087e2ae4e6b2c22f2ce3c | [
"MIT"
] | null | null | null | toyClassification/SGHMC-64/datasets.py | nicolasrosa-forks/evaluating_bdl | 2973b0d018551de0c9f087e2ae4e6b2c22f2ce3c | [
"MIT"
] | null | null | null | # code-checked
# server-checked
import torch
import torch.utils.data
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import pickle
class ToyDataset(torch.utils.data.Dataset):
def __init__(self):
... | 29.28 | 108 | 0.575137 |
4a06232bf7a2b6ec78634f4d0539bd1be322f251 | 112 | py | Python | python/2914_Copyright.py | anothel/BOJ | cfc693322e609d319aaa8705d4375d098c034b76 | [
"MIT"
] | null | null | null | python/2914_Copyright.py | anothel/BOJ | cfc693322e609d319aaa8705d4375d098c034b76 | [
"MIT"
] | null | null | null | python/2914_Copyright.py | anothel/BOJ | cfc693322e609d319aaa8705d4375d098c034b76 | [
"MIT"
] | null | null | null | def main():
A, I = map(int, input().split())
print((I - 1) * A + 1)
if __name__ == "__main__":
main()
| 14 | 34 | 0.5 |
4a0623e34bbd6e03ab008f5f4496c6dc47d1e099 | 922 | py | Python | app/ch16_mongodb/final/pypi_org/nosql/releases.py | tbensonwest/data-driven-web-apps-with-flask | be025c1c0190419019924f7516f49b3b8452cdf8 | [
"MIT"
] | 496 | 2019-07-03T05:13:24.000Z | 2022-03-27T01:15:10.000Z | app/ch16_mongodb/final/pypi_org/nosql/releases.py | tbensonwest/data-driven-web-apps-with-flask | be025c1c0190419019924f7516f49b3b8452cdf8 | [
"MIT"
] | 20 | 2019-07-07T22:09:49.000Z | 2021-12-28T03:03:09.000Z | app/ch16_mongodb/final/pypi_org/nosql/releases.py | tbensonwest/data-driven-web-apps-with-flask | be025c1c0190419019924f7516f49b3b8452cdf8 | [
"MIT"
] | 562 | 2019-07-03T14:35:21.000Z | 2022-03-31T06:23:58.000Z | import datetime
import mongoengine
class Release(mongoengine.Document):
package_id = mongoengine.StringField()
major_ver = mongoengine.IntField()
minor_ver = mongoengine.IntField()
build_ver = mongoengine.IntField()
created_date = mongoengine.DateTimeField(default=datetime.datetime.now)
com... | 26.342857 | 80 | 0.597614 |
4a062527cea05ca0d2778e1faf4bd710c8d9380a | 1,371 | py | Python | .transform/keras2tf.py | klrc/food-segmentation | f661f53120bdfe3d94b72b91a33a2286c95ed824 | [
"MIT"
] | null | null | null | .transform/keras2tf.py | klrc/food-segmentation | f661f53120bdfe3d94b72b91a33a2286c95ed824 | [
"MIT"
] | null | null | null | .transform/keras2tf.py | klrc/food-segmentation | f661f53120bdfe3d94b72b91a33a2286c95ed824 | [
"MIT"
] | null | null | null | from keras.models import load_model
import tensorflow as tf
import os
import os.path as osp
from keras import backend as K
# 路径参数
input_path = 'input path'
weight_file = 'weight.h5'
weight_file_path = osp.join(input_path, weight_file)
output_graph_name = weight_file[:-3] + '.pb'
# 转换函数
def h5_to_pb(h5_model, output_d... | 34.275 | 91 | 0.726477 |
4a0625707b6b0d328dad1814d646016888e6f695 | 1,178 | py | Python | scrapy_doubanmovie/scrapy_doubanmovie/pipelines.py | davidvivi/you-need-Python | 0a9e1fcb1f1439006304ed57771e5e8ff3a28554 | [
"MIT"
] | 4 | 2018-06-12T01:05:13.000Z | 2019-12-13T10:10:15.000Z | scrapy_doubanmovie/scrapy_doubanmovie/pipelines.py | davidvivi/you-need-Python | 0a9e1fcb1f1439006304ed57771e5e8ff3a28554 | [
"MIT"
] | 8 | 2021-03-18T21:26:26.000Z | 2022-03-11T23:33:18.000Z | scrapy_doubanmovie/scrapy_doubanmovie/pipelines.py | davidvivi/you-need-Python | 0a9e1fcb1f1439006304ed57771e5e8ff3a28554 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymysql
from . import settings
class ScrapyDoubanmoviePipeline(object):
def __init__(self):
self.connect =... | 29.45 | 104 | 0.52292 |
4a0626e89bc46c8ad5430ed182a748b308ad744c | 3,023 | py | Python | FileI:O/file_input.py | mcorley-gba/IntroCS21-22 | a823e17f2cb618be0e67468cb15f48873ae85152 | [
"MIT"
] | null | null | null | FileI:O/file_input.py | mcorley-gba/IntroCS21-22 | a823e17f2cb618be0e67468cb15f48873ae85152 | [
"MIT"
] | null | null | null | FileI:O/file_input.py | mcorley-gba/IntroCS21-22 | a823e17f2cb618be0e67468cb15f48873ae85152 | [
"MIT"
] | null | null | null | #File Input.py
#We will experiment with file inputs here.
#Saved in pi_digits.txt is the first 30 decimal places of pi.
#1. Open the file.
#2. Read the entire contents
#3. Do something (print)
#with open('pi_digits.txt') as file_object:
# contents = file_object.read()
#more commands here
#print(contents... | 30.846939 | 105 | 0.742971 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.