text
string
size
int64
token_count
int64
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 27 00:17:55 2020 @author: mehrdad """ import json import numpy as np import pandas as pd import time import math #import blist import tslib.mining import tslib.common import tslib.trip_detection import tslib.trip STORE_RESULTS = False #output_fol...
12,410
4,548
from abc import ABC, abstractmethod import gym import matplotlib.pyplot as plt import numpy as np from pathlib import Path import time from setcpp import SmoothnessDPL1Cost, SmoothnessDPPairGridCost, SmoothnessGreedy import tqdm from typing import Optional, Tuple, NoReturn from data.synthia import Frame, append_xyz_to...
24,054
6,806
# Copyright 2021 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
17,884
4,835
import numpy as np import superfast def test_sum(): a = np.array([[1,2,3],[2,3,4]]).astype('float64') assert(a.sum() == superfast.sum_row_major_order(a))
163
68
from __future__ import absolute_import, division, print_function import torch import torch.nn as nn import torch.nn.functional as F class SSIM(nn.Module): def __init__(self): super(SSIM, self).__init__() self.mu_x_pool = nn.AvgPool2d(3, 1) self.mu_y_pool = nn.AvgPool2d(3, 1) s...
3,816
1,593
import numpy as np from plato.core import as_floatx, create_shared_variable, symbolic, add_update from theano import tensor as tt class FutureWeightGradCalculator(object): def __init__(self, kp, kd, shapes): """ :param kp: :param kd: :param shapes: A tuple that specifies (minibatc...
2,413
1,073
import logging from cart import Cart from django.conf import settings from django.contrib.sites.models import get_current_site from django.utils import translation from mailtemplates.models import EMailTemplate from payment.models import PrePayment from payment.services.paypal import paypal from shop.checkout_wizard im...
5,603
1,572
class Solution: def strWithout3a3b(self, A: int, B: int) -> str: if not A and not B: return '' if A >= B: a = 2 if A >= 2 else 1 b = 2 if A - a - B < 1 and B >= 2 else 1 if B else 0 return a * 'a' + b * 'b' + self.strWithout3a3b(A - a, B - b) else: ...
498
202
"""Clean API""" import logging from pathlib import Path from . import readers log = logging.getLogger(__name__) def kinetic_model(src, dst=None, params=None, model='srtmb_basis', input_interp_method='linear', w=None, r1=1, k2p=0.000250, beta_lim=None, n_beta=40, linear_phase_start=500, ...
4,178
1,534
"""Raw CLI commands.""" from typing import IO import click from ..._templates import artifact_builder, replication_listener, source_region_core from ..._util.workers_zip import build_and_write_workers from .add import add_to_deployment from .init import init_project _TEMPLATES = {"builder": artifact_builder, "listen...
1,360
435
class ZiggeoConfig: def __init__(self): self.server_api_url = "https://srv-api.ziggeo.com" self.regions = {"r1":"https://srv-api-eu-west-1.ziggeo.com"} self.api_url = "https://api-us-east-1.ziggeo.com" self.api_regions = {"r1":"https://api-eu-west-1.ziggeo.com"} self.cdn...
503
200
_base_ = './optimizer.py' optimizer = dict( type='Adam', lr=0.003 )
77
38
from IPython.display import display from IPython.display import HTML import IPython.core.display as di # This line will hide code by default when the notebook is exported as HTML di.display_html('<script>jQuery(function() {if (jQuery("body.notebook_app").length == 0) { jQuery(".input_area").toggle(); jQuery(".promp...
5,998
2,259
from dataclasses import dataclass from typing import Dict @dataclass(frozen=True) class Facility: name: str exists: bool build_cost: float supply: float transport_cost: Dict[str, float] # customer to cost
228
72
#!/usr/bin/python # vim:set et sw=4: # # Originally from: # http://cvs.fedoraproject.org/viewvc/F-13/ca-certificates/certdata2pem.py?revision=1.1&content-type=text%2Fplain&view=co # # certdata2pem.py - converts certdata.txt into PEM format. # # Copyright (C) 2009 Philipp Kern <pkern@debian.org> # # This program is fre...
3,834
1,283
timestamp = "02-03-2022 13:12:15 on flin (by mightqxc)"
56
33
import json import os def read_config_file(filename): """ Loads and returns a configuration from the supplied filename / path. Parameters ---------- filename: string The name/path of the config file to load. Returns ---------- config: object The resulting configura...
701
196
# ------------------------------ # 26. Remove Duplicates from Sorted Array # # Description: # Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. # Do not allocate extra space for another array, you must do this in place with constant memory. # # For...
1,944
560
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # Copyright (c) 2016 Troels Agergaard Jacobsen __version__ = '0.2.0' __description__ = 'Command line utility to backup Evernote notes and notebooks.'
197
75
"""Plot clustered spikes Usage: python ncpsort.cluster_synthetic_data.inference_plot_synthetic \ --inference_dir ./inference_synthetic_N-1000/cluster_S-150-beam_NCP-10000 \ --min_cls_size 50 --plot_type overlay or --inference_dir --min_cls_size 50 --plot_type tsne """ import numpy as np imp...
6,373
2,454
""" Find (old) loanwords between two languages """ from ast import literal_eval from functools import partial from logging import getLogger from pandas import DataFrame, Series, concat, read_csv from tqdm import tqdm from panphon.distance import Distance from loanpy.helpers import gensim_multiword from loanpy.adrc ...
27,920
8,483
import scipy from scipy.io import loadmat import random import numpy as np from sklearn.metrics import zero_one_loss from sklearn.naive_bayes import BernoulliNB,MultinomialNB,GaussianNB import matplotlib.pyplot as plt from sklearn.feature_selection import mutual_info_classif import os data = loadmat('../data/Xwindo...
1,172
473
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
5,961
1,788
""" bluey_beacon.py This program connects to the bluey 1.1 Nordic nRF52 dev board made by Electronut Labs. The firmware on Bluey has to be running the "bluey beacon" example. This code is expected to be run on a Raspverry Pi 3. It assumes that you have bluez installed - it uses hcidump and hcitool. The code rea...
5,051
1,797
# -*- coding: utf-8 -*- """ Created on Wed May 8 12:43:42 2019 @author: solale In this version I will try to shrink the network and reduce the tensorization """ # Multilayer Perceptron import pandas import numpy # fix random seed for reproducibility seed = 7 numpy.random.seed(seed) # from tensorflow import set_rando...
18,374
7,293
#!/usr/bin/env python3 # # Calculates sentiment polarity scores over the progression of a speech # and writes them to STDOUT. The output can be parsed by gnuplot. # # Original author: Bastian Rieck from textblob import TextBlob import os import sys """ Calculates sentiments over the progression of a given speech. Th...
1,641
579
import numpy as np import matplotlib.pyplot as plt import warnings import pandas as pd import scipy.stats as st import statsmodels as sm import seaborn as sns import math import collections from collections import Counter import statistics import matplotlib # By state level - Fuels emission factors - 1999 t...
8,174
3,183
import os #tools for working with the CLI import logging #needed for logging import pigpio #needed for GPIO control import time #needed for function timing import threading #needed for OLED data continuous updating import csv #needed for temporary data logging import config as global_vars #import global variable initia...
16,757
4,662
nums = list(map(int,input().split(" "))) list = [] for j in range(0,5): sum = 0 for i in range(0,4): sum += nums[i] list.append(sum) temp = nums[0] del nums[0] nums.append(temp) print("{} {}".format(min(list), max(list)))
257
110
import instrumenter import unittest class TestIfExpr(unittest.TestCase): def test_if_expr(self): src = """ 5 if x > 7 else 10 """.strip() expected = """ stepper_lib.if_expr(x > 7, 5, 10) """.strip() actual = instrumenter.instrument(src, "ifexpr").strip() self.assertEqual(actual, expected) if __name__...
352
145
""" This module provides Run.SummaryList data access object """ from WMCore.Database.DBFormatter import DBFormatter from dbs.utils.dbsExceptionHandler import dbsExceptionHandler class SummaryList(DBFormatter): def __init__(self, logger, dbi, owner=""): DBFormatter.__init__(self, logger, dbi) self...
1,394
464
from rewx.core import *
25
10
import pytest @pytest.fixture def setup(kube): pass def test_something(setup, kube): assert True == True
117
43
from ..protocol import Proto import abc from typing import Any class Events(abc.ABC): def __init__(self): self._evmap = { Proto.ON_NODE_STATUS: self.on_node_status, Proto.ON_WARN: self.on_warning, Proto.ON_WATCH_INI: self.on_watch_init, Proto.ON_WATCH_UPD: ...
2,852
843
import pygame import time import random pygame.init() # display display_width = 1024 display_height = 768 gameDisplay = pygame.display.set_mode((display_width,display_height)) pygame.display.set_caption('Relâmpago Marquinhos') # colors black = (0,0,0) white = (255,255,255) red = (255,0,0) # car ca...
4,650
1,619
"""Base classes to be used in FSM.""" import copy from datetime import datetime from typing import Dict, Iterator, List, Tuple, Type # noqa import pytz from tuco.exceptions import ( TucoAlreadyLockedError, TucoEventNotFoundError, TucoInvalidStateChangeError, TucoInvalidStateHolderError, ) from tuco.l...
9,521
2,639
from PIL import Image import torch import numpy as np cityscapes_palette = [128, 64, 128, 244, 35, 232, 70, 70, 70, 102, 102, 156, 190, 153, 153, 153, 153, 153, 250, 170, 30, 220, 220, 0, 107, 142, 35, 152, 251, 152, 70, 130, 180, 220, 20, 60, 255, 0, 0, 0, 0, 142, 0, 0, 70,...
7,962
5,298
from django.conf import settings from rest_framework.settings import import_from_string from .mixins import FileContentMixin, DocStringContentMixin, MarkupProcessMixin, NoProcessMixin, SafeProcessMixin APIDOC_DEFAULT_DOCUMENTER_CLASSES = getattr( settings, 'APIDOC_DEFAULT_DOCUMENTER_CLASSES', ['rest_fra...
2,342
744
from malcolm.modules.ADCore.parts import ExposureDetectorDriverPart class AndorDriverPart(ExposureDetectorDriverPart): def setup_detector(self, child, completed_steps, steps_to_do, params=None): fs = super(AndorDriverPart, self).setup_detector( child, completed_steps, steps_to_do, params) ...
541
166
import json from typing import Callable, TypeVar, cast from .constants import CUSTOM_LOG_FORMAT, CUSTOM_EVENT_NAME_MAP, CUSTOM_PAGE_NAME_MAP from datetime import datetime import logging from airflow.settings import TIMEZONE from airflow.utils.session import create_session import functools T = TypeVar("T", bound=Calla...
1,336
471
import os import re from setuptools import setup currentPath = os.path.abspath(os.path.dirname(__file__)) def find_version(filename): with open(filename, 'r') as fh: # Read first 2048 bytes, __version__ string will be within that data = fh.read(2048) match = re.search(r'^__version__ = [...
2,674
854
from setuptools import setup setup( name='pydale', version='0.1.0a1', description='A Transfer Learning Python package', url='https://github.com/sz144/TPy', author='Shuo Zhou', author_email='szhou20@sheffield.ac.uk', license='MIT License', packages=['pydale'], install_requires=['nump...
799
254
import matplotlib.pyplot as plt import seaborn as sns from scipy.stats import kendalltau,chi2_contingency, pearsonr import pandas as pd def plot_var_num(dataset,variabile): """ Plot delle variabili numeriche -------------- Parametri: dataset: dataset di riferimento variabile: variabile da plott...
8,738
2,745
class NoMatchException(Exception): """ This exception is thrown when we fail to find a Spotify equivalent for a google play music track Args: message (str): Description of the exception """ def __init__(self, message: str): super().__init__(message) class SpotifyMalformedTrackExc...
592
155
from django.urls import path from . import views urlpatterns = [ path("login", views.login_view, name="login"), path("logout", views.logout_view, name="logout"), path("register", views.register, name="register"), path("", views.index, name="index"), path("open", views.openPage, name="openPage"), ...
638
210
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Images', fields=[ ('id', models.AutoField(verbo...
1,198
338
# Collections namedTuple nr7 import collections from collections import namedtuple Point = namedtuple("Point", {"x": 0, "y": 0, "z": 0}) newP = Point(3, 4, 5) print(newP.x, newP.y, newP.z) print(newP._fields) newP = newP._replace(x=6) print(newP) p2 = Point._make(["a", "b", "c"]) print(p2)
295
131
import os from pathlib import Path import argparse import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from jive.AJIVE import AJIVE from jive.PCA import PCA import warnings import time, datetime from random import shuffle warnings.filterwarnings(action='once') def getVarianceE...
2,879
1,073
from ..limit import * class Any(Limit): slug = 'any' name = 'Limit: Any' def __init__(self, **kwargs): super().__init__(None) self.args = kwargs.values() for arg in self.args: arg.limits = self.limits def exhausted(self) -> bool: return any(arg.exhausted()...
643
214
print('-=-' * 15) print('Analisador de Triângulos') print('-=-' * 15) sega = float(input('Primeiro Segmento: ')) segb = float(input('Segundo Segmento: ')) segc = float(input('Terceiro Segmento: ')) if sega < segb + segc and segb < sega + segc and segc < sega + segb: print('Os segmentos acima PODEM FORMAR um triângu...
396
167
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.urls import include, path from django.contrib.auth import views as auth_views urlpatterns = [ path('login', auth_views.LoginView.as_view(), name='vcn-account-login'), path('logout', auth_views.LogoutView.as_view(), {...
445
152
# /bin/hacken GameJam 2019, f0wL """This example lights up the third NeoPixel while button A is being pressed, and lights up the eighth NeoPixel while button B is being pressed.""" from adafruit_circuitplayground.express import cpx import random import time import math cpx.pixels.brightness = 0.1 while True: ...
736
292
''' For testing with the text version ''' b = [ [1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0,...
1,787
804
from .context import Context as _Context from .user import User from .document import Document from .order import Order from .order_fulfillment import OrderFulfillment from .prices import public as prices from .catalog import public as catalog from .taxes import public as tax from .core.enums import DocumentStatus as ...
5,321
1,555
""" Parse, diff, and upload sample manifests. Manifests are listings of known samples with associated barcodes and other, minimal metadata. They are usually produced by the lab processing collection tubes and contain the link between encounter survey data and molecular biology results. The workflow for processing ne...
22,234
6,293
# Generated by Django 3.0.4 on 2020-04-12 14:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('csone', '0007_gcinotes_upload'), ] operations = [ migrations.AlterField( model_name='gcinotes', name='...
419
156
import logging from typing import Optional, Dict, Any, List, Tuple, NamedTuple import torch from data.edits import Edit from dpu_utils.ptutils import BaseComponent from mlcomponents.seqdecoding import SeqDecoder from mlcomponents.seqencoder import SequenceEncoder class EncoderDecoder(BaseComponent): ...
7,467
2,049
#=========================================================================== # # Copyright (c) 2014, California Institute of Technology. # U.S. Government Sponsorship under NASA Contract NAS7-03001 is # acknowledged. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modific...
8,195
2,444
#!/usr/bin/env python3 # encoding: utf-8 """ tests.test_path_newsonkrumm2009 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Based on the data available at: https://www.microsoft.com/en-us/research/publication/hidden-markov-map-matching-noise-sparseness/ Notes: * There is a 'bug' in the map available from the website. Multiple se...
19,035
8,932
# Generated by Django 2.0.1 on 2019-06-07 01:57 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0065_auto_20190606_2240'), ] operations = [ migrations.AddField( model_name='document',...
785
274
from janus.qm_wrapper.qm_wrapper import QMWrapper from janus.qm_wrapper.psi4_wrapper import Psi4Wrapper
104
38
import urllib import urllib2 import sys import batch_interface import json if len(sys.argv) == 1: print 'Usage: python %s <command> [parameter=value] ...' % sys.argv[0] print 'Try python %s batch/help to see list of functions' % sys.argv[0] print '\tor pythor %s batch/reload to reload functions' % sys.arg...
729
276
#------------------------------------------------------------------------------- # Name: cache.py # Purpose: # # Author: xuming # # Created: 23-01-2011 # Copyright: (c) xuming 2011 # Licence: GPL #------------------------------------------------------------------------------- #!/usr/bin/env python...
3,286
922
from typing import Optional from fastapi import FastAPI import redis import json from models.team_member import Team_Member app = FastAPI() r = redis.StrictRedis(host='localhost', port=6379, db=0, password="sOmE_sEcUrE_pAsS", socket_timeout=None, connection_pool=None, charset='utf-8', errors='strict', unix_so...
908
344
''' the number numbers are not always the same length 23 * 4 4 * 3 + 20 * 4 ''' def multiply_two_numbers(A, B):
133
52
import pygame as pg class Keyboard: def __init__(self): self.reset_keys() def reset_keys(self): self.keys = { pg.K_ESCAPE: False, pg.K_LEFT: False, pg.K_RIGHT: False, pg.K_DOWN: False, pg.K_UP: False, pg.K_a: False, ...
915
286
from . import serialize_parameters from SmartFramework.string.encodings import ascii_printables from SmartFramework.tools.dictionaries import sorted_dict, sorted_filtered # ,filtered from SmartFramework.tools.objects import ( isInstance, class_has_method, ismethod_methoddescriptor_or_function, ) # ,hasMe...
53,243
14,677
#!/usr/bin/env python # -*- coding:utf-8 -*- """================================================================= @Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3 @File : LC-0189-Rotate-Array.py @Author : [YuweiYin](https://github.com/YuweiYin) @Date : 2022-01-02 ======================================...
5,112
1,928
''' One fcn returns the first nonrepeated character from string, s. The other returns the first repeated character from the string. ''' def print_dict(d): for k, v in d.items(): print('\t', k, '=> ', v) def char_count_dict(s): d = dict() for char in s: count = d.get(char, 0) d[char...
921
334
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class KoubeiCateringPosDishcateTransferModel(object): def __init__(self): self._cate_id = None self._cook_id = None self._dish_ids = None self._shop_id = None @prop...
2,652
926
from django.contrib import admin # Register your models here. from user_manager_app.models import Attendance, Support admin.site.register(Attendance) admin.site.register(Support)
181
50
import torch import torchvision import torchvision.transforms as transforms import albumentations import numpy as np # from __future__ import print_function import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets , transforms import torchvision fr...
3,557
1,274
"""CveDetail Class""" from .halo_endpoint import HaloEndpoint from .http_helper import HttpHelper class CveDetails(HaloEndpoint): """Initializing the CveDetail class: Args: session (:class:`cloudpassage.HaloSession`): This will define how you interact with the Halo API, including proxy s...
1,733
459
import pytest import tempfile import shutil from baldir_markdown_lib import read_source_file, parse_source_listing_start, import_code_snippet, format_markdown_snippet, split_against_source_listing_tags, pre_process_markdown_file_in_place, pre_process_markdown_text, pre_process_markdown_file_to_string, verify def test...
5,245
1,720
"""Automated task runner""" from typing import Any, Callable, Dict, Optional from loguru import logger from shadow.clone import ShadowClone from shadow.helpers.state import ShadowState class ShadowBot: """Base bot class""" def __init__(self): """Sets the default name and attaches the state machin...
3,014
867
from dataclasses import dataclass from typing import List, Optional, Union @dataclass class PayloadSender: phone: int name: str @dataclass class BaseModel: sender: PayloadSender payload_id: str @dataclass class PayloadContactName: first_name: str formatted_name: str last_name: Optional...
1,597
488
# Copyright 2020 Google 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 applicable law or agree...
1,501
486
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_swin.ipynb (unless otherwise specified). __all__ = ['SwinT'] # Cell #hide import timm from nbdev.showdoc import * from fastai.vision.all import * # Cell class SwinT : """Class for setting up a Swin Transformer model. The architecture is specified by `arch`, and the ...
922
289
import colander from authorize.exceptions import AuthorizeInvalidError class BaseAPI(object): def __init__(self, api): self.api = api self.config = api.config def _deserialize(self, schema, params={}): try: deserialized = schema.deserialize(params) except colande...
407
115
import stable_baselines.common.tf_util as tf_util from mpi4py import MPI from stable_baselines import logger from stable_baselines.common.cmd_util import make_mujoco_env, mujoco_arg_parser from stable_baselines.common.policies import MlpPolicy from stable_baselines.trpo_mpi import TRPO def train(env_id, num_timesteps...
1,237
446
import sys sys.path.append("..") from common import * def parse(data): data = list(map(lambda s: s.strip(),filter(lambda s: len(s) > 1,data.split("\n")))) conds = {} for i in range(20): kv = data[i].split(":") cs = kv[1].split("or") conds[kv[0]] = ([int(v) for v in cs[0].split("-")]...
929
359
import time import json import datetime from flask import request from flask import render_template from flask_restful import Resource from . import buyer, apibuyer from AppStore.models import Class_Info @buyer.route('/buyer/index/') def index(): return 'Hello World! This is buyer index.' @buyer.route('/api/b...
1,931
633
from flask_restful import Api import info def add_route(api: Api): api.add_resource(info.InfoRoute, '/')
115
43
from integrations.github.resources.base import GitHubListResource class FollowersListResource(GitHubListResource): """Ресурс данных подписчиков пользователя GitHub""" endpoint = 'users/{user_slug}/followers'
219
64
# tests/test_provider_unicell_kind.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:20:21 UTC) def test_provider_import(): import terrascript.provider.unicell.kind def test_resource_import(): from terrascript.resource.unicell.kind import kind_cluster # TODO: Shortcut imports without names...
681
230
import queryCiteFile import librarybase import pywikibot from epmclib.getPMCID import getPMCID from epmclib.exceptions import IDNotResolvedException import queue import threading import time def rununthreaded(): citefile = queryCiteFile.CiteFile() citations = citefile.findRowsWithIDType('pmc') ...
1,993
657
from day18.script1 import parse_matrix, read_char_matrix, alpha_lower, solve_world # We could use the same logic as part 1 with a state made of a distance and 4 (x, y) pairs (one for each bot) # This works with examples, but there are too many combinations for the real input so it runs for very long # # To get it qui...
2,491
827
import numpy as np from igakit.cad import circle, Pi def make_crv(p,u): c = circle(radius=1, angle=Pi/2) c.rotate(Pi/4) c.elevate(0,p-2) c.refine(0,u) return c def check_crv(c): u0, u1 = c.breaks(0)[[0,-1]] u = np.linspace(u0,u1,100) x, y, z = c(u).T r = np.hypot(x,y) return np...
1,029
422
import vim _BOOL_OPTS = set(('allowrevins', 'altkeymap', 'antialias', 'autochdir', 'arabic', 'arabicshape', 'autoindent', 'autoread', 'autowrite', 'backup', 'ballooneval', 'binary', 'bioskey', 'bomb', 'buflisted', 'buftype', 'cindent', 'compatible', 'confirm', 'con...
4,261
1,343
#!/bin/python # coding=utf-8 import schedule import time from subprocess import call # Referências: # https://pypi.org/project/schedule/ # https://stackoverflow.com/questions/373335/how-do-i-get-a-cron-like-scheduler-in-python # https://www.geeksforgeeks.org/python-schedule-library/ def postgres_backup_00_h(): ...
997
350
# -*- coding: utf-8 -*- # Copyright (c) 2017 - for information on the respective copyright owner # see the NOTICE file and/or the repository https://github.com/boschresearch/statestream # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
40,198
11,671
from distutils.core import setup setup( name='Geometry2D', version='0.7.1', author='Luis Da Costa', author_email='dacosta.le@gmail.com', packages=['geometry'], scripts=[], url='https://github.com/ldacosta/geometry2D/', license='LICENSE.txt', long_description=open('README.txt').read(...
382
139
from unittest import TestCase import numpy as np import matplotlib.pyplot as plt from .plot import rainbowplot class Fixtures: """ This class is a namespace for all the fixtures used in tests. """ nt = 2**10 nx = 2**10 t = np.linspace(0, 10, nt) x = np.linspace(-10, +10, nx) @stat...
1,341
542
from django.db.models import Count, Q from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.shortcuts import render, get_object_or_404 from .models import NewsItem, SignUp, Artist, Athlete,Category # Create your views here. def search(request): queryset = NewsItem.objects.all() ...
3,957
1,286
import datetime import glob import sys import requests from defusedxml import ElementTree as ET sys.path.append("..") from llama.alma import Alma_API_Client import llama.config as config TODAY = datetime.date.today() count_total_invoices = 0 count_invoices_updated = 0 count_invoice_errors = 0 # Update empty invoice...
2,133
765
import argparse from pathlib import Path import tensorflow as tf import torch from models.net import SPPNet def convert_mobilenetv2(ckpt_path, num_classes): def conv_converter(pt_layer, tf_layer_name, depthwise=False, bias=False): if depthwise: pt_layer.weight.data = torch.Tensor( ...
4,117
1,600
#!/usr/bin/env python import ec2 security_group = ec2.DrupalSecurityGroup() print("Created new Drupal Security Group Object:{}".format(security_group)) if security_group.exists(): print("Security Group Exists") exit(1) security_group_id = security_group.create() print("Created new EC2 Security Group ID:{}"....
347
107
# script for extracting patches from video frames suitable for neural network # training from keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array, array_to_img from PIL import Image import sys import os import glob from PIL import Image from os.path import basename, splitext import numpy as n...
2,624
880
side = [ [ "Y", "O", "W" ], [ "R", "G", "O" ], [ "O", "O", "B" ] ] new_side = [ [ 'X' for i in range(3) ] for i in range(3) ] for row_idx, row in enumerate(side): for unit_idx, unit in enumerate(row): new_side[2-unit_idx][row_idx] = unit print(new_side)
269
123
import os import time import json from random import random from datetime import datetime import pandas as pd import seaborn as sns import requests class SearchAndExtractData(object): def __init__(self, file: str, graph_name: str) -> None: self.file = file self.graph_name = graph_name def cr...
2,113
676